-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate reports when tests fail? #61
Comments
This is related how you run |
Thanks Damian, but I don't know how. I currently call: What would be a better way? |
Hi Damian. Thanks, |
Hi cbaldan. Thanks, |
Nope, still using the test failure ignore property. |
Thanks for reply, but in my case I m going to use that in Jenkins so if builds success (with failed test) it will trigger next job, which is no good for me
From: Cleber Baldan Junior [mailto:[email protected]]
Sent: 26 May 2017 14:23
To: damianszczepanik/maven-cucumber-reporting <[email protected]>
Cc: Shohil Bagdai ; Comment <[email protected]>
Subject: Re: [damianszczepanik/maven-cucumber-reporting] Generate reports when tests fail? (#61)
Nope, still using the test failure ignore property.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#61 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AWdlWa8ohUm0SfTEKm9NyxHNYRL4I69kks5r9tJAgaJpZM4MeK0O>.
|
This is certainly an issue and after the last release of Karate where we recommended this plugin, we are getting reports of users running into this issue. Until this is fixed, for the benefit of others on this thread, here is one possible workaround.
For details, look at this commit: karatelabs/karate@c5968d1 |
@ptrthomas would you like to prepare pull request for this? |
@damianszczepanik the solution above is a hack or workaround which is not the right fix for this maven-plugin. I would like to help here, just that right now I'm busy on Karate and I suspect I will need to dig into the maven life-cycle to understand what the right fix is for this plug-in. any tips from anyone with better ideas would be great. |
I have a similar challenge as shohilbagdai. Unfortunately, if we include For me, the maven-cucumber-reporting would greatly benefit from a "build-breaker" flag/logic/step/whatever. [Update: Restore XML tags] |
Hi, Did anyone found a solution for this. Currently i am also facing the same issue where if a test case has failed the report is not generated and if i add < testFailureIgnore>true< /testFailureIgnore> to Surefire it generates report but build is also success. |
Same issue. Any solutions ? |
If I'm right this is the maven feature not the issue of this project. Think this should help https://stackoverflow.com/questions/1923857/is-there-a-way-to-fail-fast-for-junit-with-the-maven-surefire-plugin |
I can't see how making Maven fail fast helps us get the reports generated. I spent some time thinking on this matter and thought of some possible ways to go:
1) Perhaps the most elegant solution would be finding out if Cucumber has a plugin architecture and allows using of an external tool to generate the reports. This would be straight forward, keep a clean and organized architecture but not sure they do have such functionality. I'll investigate in the next days. 2) If I'm not mistaken, older versions of Cucumber-reporting would throw an error when it found out that there were test erros/failures. So what I did back then was: set The last 2 options are a bigger stretch, but they sound reasonable to me, and I think it would improve a lot Maven support for testomg needs. 3) Add a specific phase in Maven's lifecycle to generate test reports, which by default would be executed regardless of the tests result - success or failure. 4) Create a new property in Maven, specific to allow any other plugin to be run after the test phase. Let's see, I'll get active in this in the next days. Regards, |
Perhpas Maven already has support for this. http://maven.apache.org/surefire/maven-failsafe-plugin/ So we should make a test. Bind Cucumber-JVM to integration-test and Maven-cucumber-reporting to post-integration-test. |
At least it will move report execution to verify phrase. I don't think this is plugin responsibility excep https://github.com/damianszczepanik/maven-cucumber-reporting/blob/master/src/main/java/net/masterthought/cucumber/CucumberReportGeneratorMojo.java#L110 |
I made a poc and got it all to work successfully under maven failsafe plugin, but the code is still too messy. |
I just pushed to my repo the branch I made the pom configuration as simple as possible: The only thing is that cucumber-reporting does not like to be in the Thanks,
|
I have seen similar problems and all of them were related to log4j version. Take a look at closed issues https://github.com/damianszczepanik/cucumber-reporting/issues?q=is%3Aissue+is%3Aclosed |
I agree @damianszczepanik , but If it gets commented out, no errors arise.
|
I'm pretty sure it is not. Through out the dependencies I believe there are many log4j as this is very popular logging library. |
That's not what maven is saying. Can you prove me wrong? |
RESOLVED 👍 mvn install -Dmaven.test.failure.ignore=true |
I found the solution for this. Use failsafe plugin:
Hope it helps |
Hello.
I'm trying to improve my project setup and I couldn't find the answer in the documentation.
We do not use Jenkins, so that's not an option for me.
Also, I want the reports generated every time the maven test target is invoked.
So, this is how my plugin is setup:
When there are no failures, the plugin is executed as expected:
But when a test does fails, the report generation is skipped:
I do want reports generated when there are test failures, the way I currently make it happen is setting this property in my pom:
Then the report does get generated, but the Test Automation suite is reported as SUCCESS:
Am I missing something? Is there a better way to configure the project and get reports even when tests fail?
Thanks,
Cleber.
The text was updated successfully, but these errors were encountered: