Skip to content

Commit

Permalink
test: Re-introduced logPublisherWorkflowStep test =)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Chavez committed Oct 25, 2018
1 parent e1bcef0 commit d873b8e
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,22 @@ public static void init() throws Exception {
* Run a workflow job using {@link LogParserPublisher} and check for success.
*/
@Test
@Ignore
public void logParserPublisherWorkflowStep() throws Exception {
assertTrue(true);
// WorkflowJob job = jenkinsRule.jenkins.createProject(WorkflowJob.class, "logParserPublisherWorkflowStep");
// FilePath workspace = jenkinsRule.jenkins.getWorkspaceFor(job);
// workspace.unzipFrom(getClass().getResourceAsStream("./maven-project1.zip"));
// job.setDefinition(new CpsFlowDefinition(""
// + "node {\n"
// + " def mvnHome = tool '" + mavenInstallation.getName() + "'\n"
// + " sh \"${mvnHome}/bin/mvn clean install\"\n"
// + " step([$class: 'LogParserPublisher', projectRulePath: 'logparser-rules.txt', useProjectRule: true])\n"
// + "}\n", true)
// );
// jenkinsRule.assertBuildStatusSuccess(job.scheduleBuild2(0));
// LogParserAction result = job.getLastBuild().getAction(LogParserAction.class);
// assertEquals(0, result.getResult().getTotalErrors());
// assertEquals(2, result.getResult().getTotalWarnings());
// assertEquals(0, result.getResult().getTotalInfos());
WorkflowJob job = jenkinsRule.jenkins.createProject(WorkflowJob.class, "logParserPublisherWorkflowStep");
FilePath workspace = jenkinsRule.jenkins.getWorkspaceFor(job);
workspace.unzipFrom(getClass().getResourceAsStream("./maven-project1.zip"));
job.setDefinition(new CpsFlowDefinition(""
+ "node {\n"
+ " def mvnHome = tool '" + mavenInstallation.getName() + "'\n"
+ " sh \"${mvnHome}/bin/mvn clean install\"\n"
+ " step([$class: 'LogParserPublisher', projectRulePath: 'logparser-rules.txt', useProjectRule: true])\n"
+ "}\n", true)
);
jenkinsRule.assertBuildStatusSuccess(job.scheduleBuild2(0));
LogParserAction result = job.getLastBuild().getAction(LogParserAction.class);
assertEquals(0, result.getResult().getTotalErrors());
assertEquals(2, result.getResult().getTotalWarnings());
assertEquals(0, result.getResult().getTotalInfos());
}

}

0 comments on commit d873b8e

Please sign in to comment.