Skip to content

Commit

Permalink
[JENKINS-30088] Cleaner appearance of nodes with blocks.
Browse files Browse the repository at this point in the history
· Use the function name, not step display name, on the overall start and end nodes.
· Omit any text on the block start and end nodes.
  • Loading branch information
jglick committed Apr 8, 2016
1 parent 654e8b4 commit 2ef59e1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Expand Up @@ -42,9 +42,9 @@ protected String getTypeFunctionName() {
StepDescriptor d = getDescriptor();
boolean isBody = getStartNode().isBody();
if (isBody) {
return "} //" + (d != null ? d.getFunctionName() : getStartNode().getStepName());
return "}";
} else {
return getStartNode().getStepName() + " : End";
return "} // " + (d != null ? d.getFunctionName() : getStartNode().getStepName());
}
}

Expand Down
Expand Up @@ -51,9 +51,9 @@ protected String getTypeDisplayName() {
protected String getTypeFunctionName() {
StepDescriptor d = getDescriptor();
if (isBody()) {
return (d != null ? d.getFunctionName() : descriptorId) + " {";
return "{";
} else {
return getStepName() + " : Start";
return (d != null ? d.getFunctionName() : descriptorId) + " {";
}
}

Expand Down
Expand Up @@ -49,6 +49,8 @@
import org.jvnet.hudson.test.JenkinsRule;

import javax.mail.Folder;
import org.junit.ClassRule;
import org.jvnet.hudson.test.BuildWatcher;

/**
* Test of {@link WorkflowJob} that doesn't involve Jenkins restarts.
Expand All @@ -57,6 +59,8 @@
*/
public class WorkflowJobNonRestartingTest extends AbstractCpsFlowTest {

@ClassRule public static BuildWatcher buildWatcher = new BuildWatcher();

WorkflowJob p;

@Before public void setUp() throws Exception {
Expand Down Expand Up @@ -132,7 +136,6 @@ public void testRetry() throws Exception {

String log = JenkinsRule.getLog(b);
jenkins.assertLogNotContains("\tat ", b);
System.err.println(log);

int idx = 0;
for (String msg : new String[] {
Expand All @@ -152,14 +155,14 @@ public void testRetry() throws Exception {

idx = 0;
for (String msg : new String[] {
"[Pipeline] Retry the body up to N times : Start",
"[Pipeline] retry {",
"[Pipeline] } //retry",
"[Pipeline] retry {",
"[Pipeline] } //retry",
"[Pipeline] retry {",
"[Pipeline] } //retry",
"[Pipeline] Retry the body up to N times : End",
"[Pipeline] {",
"[Pipeline] }",
"[Pipeline] {",
"[Pipeline] }",
"[Pipeline] {",
"[Pipeline] }",
"[Pipeline] } // retry",
}) {
idx = log.indexOf(msg, idx + 1);
assertTrue(msg + " not found", idx != -1);
Expand Down

0 comments on commit 2ef59e1

Please sign in to comment.