allure-framework / allure-framework/allure2
XRAY Plugin -> Null pointer exception when trying to import results into XRay
- Dominant language
- HTML
- Stars
- 5.5k
- Forks
- 784
- Avg merge
- 2d 33m
- Merged PRs (30d)
- 16
Description
**Describe the bug**
When importing results into XRay by executing "generate allure-results --clean" the following error is generated:
Exception in thread "main" java.lang.NullPointerException
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.qameta.allure.xray.XrayTestRunExportPlugin.updateTestRunStatuses(XrayTestRunExportPlugin.java:105)
at io.qameta.allure.xray.XrayTestRunExportPlugin.aggregate(XrayTestRunExportPlugin.java:94)
at io.qameta.allure.ReportGenerator.aggregate(ReportGenerator.java:53)
at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:70)
at io.qameta.allure.ReportGenerator.generate(ReportGenerator.java:58)
at io.qameta.allure.Commands.generate(Commands.java:102)
at io.qameta.allure.CommandLine.run(CommandLine.java:152)
at java.util.Optional.orElseGet(Optional.java:267)
at io.qameta.allure.CommandLine.main(CommandLine.java:88)
**To Reproduce**
1. Create two tests in NUnit:
. [Test]
[AllureIssue("TP-2")]
[AllureTms("TP-3")]
public void FirstTest()
{
Assert.Pass;
}
. [Test]
[AllureIssue("TP-2")]
[AllureTms("TP-4")]
public void SecondTest()
{
Assert.Pass;
}
2. In Jira / Xray:
Create a Story = TP-2
Create two test cases = TP-3 and TP-4
Create a Test Execution (TP-5) and add tests TP-3 and TP-4
4. Add the following to Environment variables for the user:
ALLURE_JIRA_ENDPOINT = https://#####.atlassian.net/jira/rest/
ALLURE_JIRA_PASSWORD = {api token}
ALLURE_JIRA_USERNAME = {email address}
ALLURE_XRAY_ENABLED = true
ALLURE_XRAY_EXECUTION_ISSUES = TP-5
5. Run the tests via NUnit and try to generate the report with "generate allure-results --clean"
**Expected behavior**
I expect the Allure report to be generated and test results to be added to the Xray test execution
**Environment (please complete the following information):**
| Allure version | 2.17.0 |
| --- | --- |
| Test framework | NUnit@3.13.2 |
| Allure adaptor | NUnit.Allure@1.0.14 |
| Generate report using | allure cli via powershell or cmd |
|OS| Windows 10|
**Additional context**
If you set ALLURE_XRAY_ENABLED = false, open a new CMD prompt you can generate a report without any errors.
Contributor guide
Research direction
Start in XrayTestRunExportPlugin.java at updateTestRunStatuses (line 105), then trace its call from aggregate. Reproduce with the two NUnit tests, Xray enabled, and `generate allure-results --clean`; compare with Xray disabled. Done means report generation completes and the results are added to the Xray test execution without a NullPointerException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100