diff --git a/src/test/java/org/jenkinsci/plugins/logparser/LogParserWorkflowTest.java b/src/test/java/org/jenkinsci/plugins/logparser/LogParserWorkflowTest.java index 6dcc75e..8379d3c 100644 --- a/src/test/java/org/jenkinsci/plugins/logparser/LogParserWorkflowTest.java +++ b/src/test/java/org/jenkinsci/plugins/logparser/LogParserWorkflowTest.java @@ -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()); } }