Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31029

no known implementation of class jenkins.tasks.SimpleBuildWrapper

    XMLWordPrintable

    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.

        Attachments

          Activity

          dblock Daniel Doubrovkine created issue -
          jglick Jesse Glick made changes -
          Field Original Value New Value
          Resolution Cannot Reproduce [ 5 ]
          Status Open [ 1 ] Resolved [ 5 ]
          dblock Daniel Doubrovkine made changes -
          Component/s ansicolor-plugin [ 15995 ]
          dblock Daniel Doubrovkine made changes -
          Assignee Jesse Glick [ jglick ] Daniel Doubrovkine [ dblock ]
          Resolution Cannot Reproduce [ 5 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          rtyler R. Tyler Croy made changes -
          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.

          {quote}
          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>.*"));
                      }
                  });
              }

          }{quote}

          {quote}
          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)
          {quote}

          See https://github.com/dblock/jenkins-ansicolor-plugin/pull/60.
          A straightforward JUnit test is failing on OSX and succeeds on Linux, presumably this means the implementation will be broken on OSX as well.

          {code}
          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>.*"));
                      }
                  });
              }

          }
          {code}

          {code}
          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)
          {code}

          See https://github.com/dblock/jenkins-ansicolor-plugin/pull/60.
          dblock Daniel Doubrovkine made changes -
          Component/s workflow-plugin [ 18820 ]
          davidkarlsen davidkarlsen made changes -
          Assignee Daniel Doubrovkine [ dblock ] davidkarlsen [ davidkarlsen ]
          davidkarlsen davidkarlsen made changes -
          Assignee davidkarlsen [ davidkarlsen ] Daniel Doubrovkine [ dblock ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 166192 ] JNJira + In-Review [ 186323 ]

            People

            Assignee:
            dblock Daniel Doubrovkine
            Reporter:
            dblock Daniel Doubrovkine
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated: