Xray-App / xray-maven-plugin

Xray Maven Plugin
BSD 3-Clause "New" or "Revised" License
26 stars 12 forks source link

Import does not work with Cucumber failed scenario #52

Closed Janos893 closed 2 years ago

Janos893 commented 2 years ago

Hi!

I have been using the plugin with Cucumber framework.

When I execute a test from the command line and the commands is in one line (e.g. mvn clean test xray:import-results) and there are failed scenarios, then the import does not work. If there are not any failed scenarios it works.

Of course,the commands are working after each other.

Configuration:

        <plugin>
            <groupId>app.getxray</groupId>
            <artifactId>xray-maven-plugin</artifactId>
            <version>0.7.0</version>
            <configuration>
                <cloud>false</cloud>
                <jiraBaseUrl>**********</jiraBaseUrl>
                <jiraUsername>********</jiraUsername>
                <jiraPassword>********</jiraPassword>
                <reportFormat>cucumber</reportFormat>
                <reportFile>target/CucumberResult.json</reportFile>
                <abortOnError>true</abortOnError>
                <filterId>1200</filterId>
                <outputDir>features</outputDir>
            </configuration>
    </plugin>

Reproduction:

  1. Use a cucumber project where there will be some failed scenario
  2. Run test and import the results from CMD in one line: mvn clean test xray:import-results The import does not work. I did not get any response message from Xray. As if the plugin do not send the json to Xray.

The import works in this case (the commands in two line):

  1. Use a cucumber project where there will be some failed scenario
  2. Run test from CMD: mvn clean test
  3. Wait for end of tests
  4. Import: mvn xray:import-results

Thanks for your help.

bitcoder commented 2 years ago

Can you please replicate this without using this maven plugin. In other words,

bitcoder commented 2 years ago

Now I understood you... sorry. So, the thing is the test task fails and then it aborts the build.

This command should make the task proceed and ignore failures.

mvn test -Dmaven.test.failure.ignore=true

bitcoder commented 2 years ago

If you don't want the build to pass but still want the xray:import-results to proceed, this may work.

mvn clean test xray:import-results --fail-at-end

Please let me know if any or both of these approaches worked

Just for reference: https://stackoverflow.com/questions/4174696/making-maven-run-all-tests-even-when-some-fail

Janos893 commented 2 years ago

The -Dmaven.test.failure.ignore=true command is working. The --fail-at-end as well as the --fail-never commands are not working.

Thank you for your help.