allure2
allure2 copied to clipboard
XRAY Plugin -> Null pointer exception when trying to import results into XRay
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
- 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; }
-
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
-
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
-
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 | [email protected] |
| Allure adaptor | [email protected] |
| 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.
@marcm-qa can you please check the variable "ALLURE_XRAY_EXECUTION_ISSUES = TP-5" is initialized as mentioned? If so can you rerun the tests with ALLURE_XRAY_EXECUTION_ISSUES=TP-5 (without space character after "=")
fixed via #1509
@fedavar I don't have a space in the environment settings. This is what I have set as Environment Variables.

Once 2.17.1 is released I will try it again.
@fedavar I have tried on 2.17.1 and get the same issue.
I have also tried on 2.16.0 and 2.14.0 and all have the same issue. If you give me some pointers I am happy to try to debug the issue
@marcm-qa so feel free to provide a fix then
Still reproducible. How we can fix it?
Still encountering this issue. Any solution?