Details
-
Type:
Bug
-
Status: Reopened (View Workflow)
-
Priority:
Major
-
Resolution: Unresolved
-
Component/s: ansicolor-plugin
-
Labels:None
-
Environment:fails on OSX, works on Linux
-
Similar Issues:
Description
A straightforward JUnit test is failing on OSX and succeeds on Linux, presumably this means the implementation will be broken on OSX as well.
public class AnsiColorBuildWrapperWorkflowTest { @ClassRule public static BuildWatcher buildWatcher = new BuildWatcher(); @Rule public RestartableJenkinsRule story = new RestartableJenkinsRule(); @Test public void testWorkflowWrap() throws Exception { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { Assume.assumeTrue(!Functions.isWindows()); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition( "node {\n" + " wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2]) {\n" + " sh(\"\"\"#!/bin/bash\n" + " echo -e '\\\\e[31mred\\\\e[0m'\"\"\"\n" + " )\n" + " }\n" + "}" )); story.j.assertBuildStatusSuccess(p.scheduleBuild2(0)); StringWriter writer = new StringWriter(); p.getLastBuild().getLogText().writeHtmlTo(0L, writer); assertTrue(writer.toString().matches("(?s).*<span style=\"color: #CD0000;\">red</span>.*")); } }); } }
java.lang.UnsupportedOperationException: no known implementation of class jenkins.tasks.SimpleBuildWrapper is named AnsiColorBuildWrapper
at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:233)
at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:186)
at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:91)
at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)
See https://github.com/dblock/jenkins-ansicolor-plugin/pull/60.
Daniel Doubrovkine, I think there was some missed context here which led to a misunderstanding. The link to the build in Travis definitely writes off the possibility for a developer-local environment problem IMHO.
I think making the component ansicolor-plugin until we can isolate it further is a good plan.
I thought this might be a JDK issue since Owen Mehegan mentioned in this comment that things fail for him when running on OS X with Java 6? A while back we moved the core JRE requirement from JRE6 to JRE7 but it looks like Travis is using JDK7 (java version "1.7.0_45")