Skip to content

Commit

Permalink
[JENKINS-44074] Add unit tests for the detection of the reports gener…
Browse files Browse the repository at this point in the history
…ated by the maven-failsafe-plugin
  • Loading branch information
Cyrille Le Clerc committed May 5, 2017
1 parent dd20081 commit ffe657f
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -170,12 +170,18 @@ public void maven_build_jar_project_on_master_succeeds() throws Exception {
verifyFileIsFingerPrinted(pipeline, build, "jenkins/mvn/test/mono-module-maven-app/0.1-SNAPSHOT/mono-module-maven-app-0.1-SNAPSHOT.jar");
verifyFileIsFingerPrinted(pipeline, build, "jenkins/mvn/test/mono-module-maven-app/0.1-SNAPSHOT/mono-module-maven-app-0.1-SNAPSHOT.pom");

// verify Junit Archiver is called for jenkins.mvn.test:mono-module-maven-app
jenkinsRule.assertLogContains("[withMaven] Archive test results for Maven artifact MavenArtifact{jenkins.mvn.test:mono-module-maven-app::0.1-SNAPSHOT}", build);
// verify Junit Archiver is called for maven-surefire-plugin
jenkinsRule.assertLogContains("[withMaven] Archive test results for Maven artifact MavenArtifact{jenkins.mvn.test:mono-module-maven-app::0.1-SNAPSHOT} " +
"generated by PluginInvocation{org.apache.maven.plugins:maven-surefire-plugin", build);

// TODO check why we have "[build-on-master #1] None of the test reports contained any result" when there should be 1 result
TestResultAction testResultAction = build.getAction(TestResultAction.class);
System.out.println(getClass() + " testResultAction: " + testResultAction);

// verify Junit Archiver is called for maven-failsafe-plugin
jenkinsRule.assertLogContains("[withMaven] Archive test results for Maven artifact MavenArtifact{jenkins.mvn.test:mono-module-maven-app::0.1-SNAPSHOT} " +
"generated by PluginInvocation{org.apache.maven.plugins:maven-failsafe-plugin", build);

// verify Task Scanner is called for jenkins.mvn.test:mono-module-maven-app
jenkinsRule.assertLogContains("[withMaven] Scan Tasks for Maven artifact MavenArtifact{jenkins.mvn.test:mono-module-maven-app::0.1-SNAPSHOT}", build);
// TODO check why we have "Found 0 files to scan for tasks" when there should be 2 java files to scan
Expand Down

0 comments on commit ffe657f

Please sign in to comment.