Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import static org.junit.Assert.*;
import org.junit.Assume;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.runners.model.Statement;
import org.jvnet.hudson.test.BuildWatcher;
Expand Down Expand Up @@ -88,6 +89,34 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
});
}

@Test
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should create a JIRA issue for these and add @Issue.

@Ignore
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dblock The test is ignored, so it never even ran.

public void testMultilineEscapeSequence() throws Exception {
story.then(r -> {
FreeStyleProject p = r.createFreeStyleProject();
p.getBuildWrappersList().add(new AnsiColorBuildWrapper(null));
p.getBuildersList().add(new TestBuilder() {
@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
listener.getLogger().println("\u001B[1;34mThis text should be bold and blue");
listener.getLogger().println("\u001B[mThis text should be normal");
return true;
}
});
FreeStyleBuild b = r.buildAndAssertSuccess(p);
StringWriter writer = new StringWriter();
b.getLogText().writeHtmlTo(0L, writer);
String html = writer.toString();
System.out.print(html);
assertThat(html.replaceAll("<span style=\"display: none\">.+?</span>", ""),
allOf(
// <b> and <span> are never closed.
containsString("<b><span style=\"color: #1E90FF;\">This text should be bold and blue</span></b>"),
// This should be inside of a span with `display: none`, but it is not.
not(containsString("\u001B[m"))));
});
}

@Issue("JENKINS-54133")
@Test
public void testWorkflowWrap() throws Exception {
Expand Down