-
Notifications
You must be signed in to change notification settings - Fork 61
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
Enabling the Post-Integration-test phase to run on test failure #59
Comments
@nab0310 I'm experiencing the same problem. Will you provide an example of your configuration of the My scenario is as follows: I have a multi-module maven project. The main module produces a docker image as an artifact. Another module (the last one to run in my build) is used to build and run end-to-end tests using a combination of the Looking at the project build from the perspective of maven phases results in the following simplified view: Maven Phase -> Plugin:goal
Using the This issue gets a big +1 vote from me. Fixing it would make this plugin work more like the |
I did a little research on the The It contains details such as how many tests:
Based on configuration there could be many summary reports of this style. All these are created by the IntegrationTestMojo during the integration-test phase. So, simply put, that Mojo does not fail the build by throwing Then there is the Failing the build in this manner allows the The |
@axiopisty Using my fork, my maven config is as follows. All I did in my fork was to write out to a file the word "failure" and then read it in the verify stage. This was just a rough prototype because I wanted to gage interest from the maintainers if they even wanted something like this as a feature. In order to make this a viable solution there would have to be some more work done in understanding how the
|
@nab0310 I think it would be helpful if you were to open a PR with your changes so we can review the changes you made on your branch. If you do, please reference this issue in your PR. |
I opened the PR |
I'm running into a similar issue with docker tests. It would be useful to have this functionality |
@nab0310 @axiopisty I wonder if it is possible if we can produce the same failsure-summary.xml and let maven-failsafe-plugin's VerifyMojo to do its task? The first to achieve that perhaps is that we should not require to disable surefire? |
@cheeseng Perhaps this plugin could create the xml file and delegate the verification to the failsafe plugin. But it seems to me that it might be easier to just create the functionality directly within this plugin rather than trying to couple everything together with the failsafe plugin. I doubt the maintainers of the surefire and failsafe plugins (which are both maintained from the same source repository) would be considering the xml files they generate and read to be part of some public API. So I tend to think it would be easier to just replicate the idea and implement a solution directly within the scalatest-maven-plugin. |
@cheeseng I doubt that maintainers of the scalatest-maven-plugin would want to start receiving issues being reported by people who might be using both the scalatest-maven-plugin and the surefire/failsafe plugins. To quote Offspring: "You gotta keep 'em separated!" |
@axiopisty That's true, looking at @nab0310 's it appears to be very near we can have it already. The PR looks good just I don't have a good way to test it. |
I wonder if there might be examples of test cases in the failsafe repository. |
@axiopisty I added a comment to the PR here: https://github.com/scalatest/scalatest-maven-plugin/pull/60/files#r911599853 I don't quite get how verify stage work yet, by any chance do you mind to check if that's intended behavior to always throw the exception? Cheers. |
We stopped using this plugin in our project for a variety of reasons. Our project has been completely rewritten and doesn't even use scala anymore. So I don't have any easy way to contribute anything other than what I already have in comments. Sorry. |
@axiopisty No worry, thanks for your comments so far, they are useful! :) |
Hello,
I want to use the scalatest-maven-plugin to run dockerized integration tests. Similarly to #45 I was stuck because a failing test would fail the build immediately. One solution that I came up with for remedying this situation was to make a flag,
runVerifyOnFailure
that would cause the setup for a verify stage to be preformed within the test phase if there was a failure. Then you would have to include theverify
stage on your plugin config and that is where it would detect the failures. Because theverfiy
stage runs after thepost-integration-test
phase in maven, the docker cleanup would have already happened, remedying the issue.I'm just seeking feedback on if this would even be something feasible that the maintainers would want in the project. Heres a rough draft of what I was thinking on my fork: nab0310@65913b2
The text was updated successfully, but these errors were encountered: