allure2 icon indicating copy to clipboard operation
allure2 copied to clipboard

XRAY Plugin -> Null pointer exception when trying to import results into XRay

Open marcm-qa opened this issue 3 years ago • 8 comments

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; }

  1. 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

  2. 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

  3. 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 avatar Dec 07 '21 22:12 marcm-qa

@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 "=")

fedavar avatar Dec 08 '21 13:12 fedavar

fixed via #1509

baev avatar Dec 08 '21 15:12 baev

@fedavar I don't have a space in the environment settings. This is what I have set as Environment Variables. image

Once 2.17.1 is released I will try it again.

marcm-qa avatar Dec 08 '21 17:12 marcm-qa

@fedavar I have tried on 2.17.1 and get the same issue.

marcm-qa avatar Dec 08 '21 17:12 marcm-qa

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 avatar Dec 08 '21 17:12 marcm-qa

@marcm-qa so feel free to provide a fix then

baev avatar Dec 09 '21 11:12 baev

Still reproducible. How we can fix it?

NaZaRKIN123 avatar Aug 10 '22 08:08 NaZaRKIN123

Still encountering this issue. Any solution?

jp-pulido avatar Dec 13 '22 18:12 jp-pulido