Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HUDSON-8415] M2 and M3 builds behave differently when tests fail
- Loading branch information
Showing
3 changed files
with
86 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
test/src/test/java/hudson/maven/MavenBuildSurefireFailedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package hudson.maven; | ||
|
||
import hudson.model.Result; | ||
import hudson.tasks.Maven.MavenInstallation; | ||
|
||
import org.jvnet.hudson.test.Bug; | ||
import org.jvnet.hudson.test.ExtractResourceSCM; | ||
import org.jvnet.hudson.test.HudsonTestCase; | ||
|
||
/** | ||
* @author Olivier Lamy | ||
*/ | ||
public class MavenBuildSurefireFailedTest extends HudsonTestCase { | ||
|
||
@Bug(8415) | ||
public void testMaven2Unstable() throws Exception { | ||
configureDefaultMaven(); | ||
MavenModuleSet m = createMavenProject(); | ||
m.setGoals( "test" ); | ||
m.setScm(new ExtractResourceSCM(getClass().getResource("maven-multimodule-unit-failure.zip"))); | ||
assertBuildStatus(Result.UNSTABLE, m.scheduleBuild2(0).get()); | ||
} | ||
|
||
@Bug(8415) | ||
public void testMaven2Failed() throws Exception { | ||
configureDefaultMaven(); | ||
MavenModuleSet m = createMavenProject(); | ||
m.setGoals( "test -Dmaven.test.failure.ignore=false" ); | ||
m.setScm(new ExtractResourceSCM(getClass().getResource("maven-multimodule-unit-failure.zip"))); | ||
assertBuildStatus(Result.FAILURE, m.scheduleBuild2(0).get()); | ||
} | ||
|
||
@Bug(8415) | ||
public void testMaven3Unstable() throws Exception { | ||
MavenModuleSet m = createMavenProject(); | ||
m.setMaven( configureMaven3().getName() ); | ||
m.setGoals( "test" ); | ||
m.setScm(new ExtractResourceSCM(getClass().getResource("maven-multimodule-unit-failure.zip"))); | ||
assertBuildStatus(Result.UNSTABLE, m.scheduleBuild2(0).get()); | ||
} | ||
|
||
@Bug(8415) | ||
public void testMaven3Failed() throws Exception { | ||
MavenModuleSet m = createMavenProject(); | ||
m.setMaven( configureMaven3().getName() ); | ||
m.setGoals( "test -Dmaven.test.failure.ignore=false" ); | ||
m.setScm(new ExtractResourceSCM(getClass().getResource("maven-multimodule-unit-failure.zip"))); | ||
assertBuildStatus(Result.FAILURE, m.scheduleBuild2(0).get()); | ||
} | ||
|
||
|
||
} |
Binary file added
BIN
+7.59 KB
test/src/test/resources/hudson/maven/maven-multimodule-unit-failure.zip
Binary file not shown.