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
Maven build won't fail when karma test fails #613
Comments
It will fail the build if your karma tests fail. You might have set up the configuration wrong somehow. |
Thank you for the quick response. I tried to run a failed java junit test, it caused the maven build to fail. but karma test fail still will not make the maven build to fail. tests karmathis is my karma set up |
I'm running into the same problem. Maven build status is success although a karma test failed. pom.xml
Maven console output: `[ERROR] There are test failures. [INFO] ------------------------------------------------------------------------ |
Are you using a recent version of Maven? |
Maven version is 3.3.9 |
Can you try git cloning this repository, do some fiddling with https://github.com/eirslett/frontend-maven-plugin/blob/master/frontend-maven-plugin/src/it/example%20project/src/test/javascript/squareSpec.js so the test fails? (maybe replace 9 with 8 in the source code) The expected result then would be that the whole build fails? |
Also experiencing similar problem. I'm using create-react-app and configured to run <plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<workingDirectory>src/main/app</workingDirectory>
<installDirectory>.mvn</installDirectory>
<environmentVariables>
<CI>true</CI>
</environmentVariables>
<check>
<haltOnFailure>true</haltOnFailure>
</check>
</configuration>
<executions>
<execution>
<id>Install Node and NPM</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v6.10.3</nodeVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm test</id>
<goals>
<goal>npm</goal>
</goals>
<phase>test</phase>
<configuration>
<arguments>test</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
|
I cloned this repository and changed squareSpec.js to provoke a build failure: The failed karma test is recognized during the build but it doesn't lead to a maven build failure.
|
Isn't this because BTW, I'm considering filing this as a dedicated issue to at least discuss this. This seems like a pretty dangerous default? I mean, who would want his build to not fail by default and be aware of it when something goes wrong? I'm genuinely curious if there's a rationale behind this, or this is just because (which I could understand) this was initially like this and so it was decided to not change the behaviour? |
Wow, that's definitely a regression. Fail on error must be true by default, from the plugin's side. |
@jcarsique it appears some people are having problems with the plugin not failing as expected after this change: #572 How do you suggest it should be fixed so that your use case is still valid, but when people run karma tests, the build fails when unit tests fail? |
@eirslett Thank you! |
By default if karma test fail the maven build should fail right? But my maven build was successful even if I made the karma test failed.
The text was updated successfully, but these errors were encountered: