/** Fingerprinter failed to work on the matrix project. */ @Email("http://www.nabble.com/1.286-version-and-fingerprints-option-broken-.-td22236618.html") public void testFingerprinting() throws Exception { MatrixProject p = createMatrixProject(); p.getBuildersList().add(new Shell("touch p")); p.getPublishersList().add(new ArtifactArchiver("p", null, false)); p.getPublishersList().add(new Fingerprinter("", true)); assertBuildStatusSuccess(p.scheduleBuild2(0).get()); }
@Issue("JENKINS-27162") @Test public void completedLogging() throws Exception { MatrixProject project = j.createMatrixProject(); project.setAxes(new AxisList(new Axis("axis", "a", "b"))); ((DefaultMatrixExecutionStrategyImpl) project.getExecutionStrategy()) .setTouchStoneCombinationFilter("axis == 'a'"); MatrixBuild build = project.scheduleBuild2(0).get(); j.assertLogContains("test0 » a completed with result SUCCESS", build); j.assertLogContains("test0 » b completed with result SUCCESS", build); }
/** Tests that axes are available as build variables in the Maven builds. */ public void testBuildAxisInMaven() throws Exception { MatrixProject p = createMatrixProject(); p.getBuildersList().add(new Maven("-Dprop=${db} validate", null)); // we need a dummy build script that echos back our property p.setScm(new SingleFileSCM("pom.xml", getClass().getResource("echo-property.pom"))); MatrixBuild build = p.scheduleBuild2(0).get(); List<MatrixRun> runs = build.getRuns(); assertEquals(4, runs.size()); for (MatrixRun run : runs) { assertBuildStatus(Result.SUCCESS, run); String expectedDb = run.getParent().getCombination().get("db"); System.out.println(run.getLog()); assertLogContains("assertion " + expectedDb + "=" + expectedDb, run); // also make sure that the variables are expanded at the command line level. assertFalse(run.getLog().contains("-Dprop=${db}")); } }
/** Tests that axes are available as build variables in the Ant builds. */ public void testBuildAxisInAnt() throws Exception { MatrixProject p = createMatrixProject(); Ant.AntInstallation ant = configureDefaultAnt(); p.getBuildersList().add(new Ant("-Dprop=${db} test", ant.getName(), null, null, null)); // we need a dummy build script that echos back our property p.setScm( new SingleFileSCM( "build.xml", "<project default='test'><target name='test'><echo>assertion ${prop}=${db}</echo></target></project>")); MatrixBuild build = p.scheduleBuild2(0, new Cause.UserCause()).get(); List<MatrixRun> runs = build.getRuns(); assertEquals(4, runs.size()); for (MatrixRun run : runs) { assertBuildStatus(Result.SUCCESS, run); String expectedDb = run.getParent().getCombination().get("db"); assertLogContains("assertion " + expectedDb + "=" + expectedDb, run); } }