Skip to content

Commit

Permalink
Merge pull request #215 from amuniz/JENKINS-30088
Browse files Browse the repository at this point in the history
[JENKINS-30088] Clean up step display in logs
Originally-Committed-As: 9ae86c4219d741e1e6e5a99ef1df27fdf08edb5c
  • Loading branch information
jglick committed Oct 7, 2015
2 parents 84da6eb + d30192c commit e955d74
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
Expand Up @@ -148,14 +148,14 @@ public void testRetry() throws Exception {

idx = 0;
for (String msg : new String[] {
"Running: Retry the body up to N times : Start",
"Running: Retry the body up to N times : Body : Start",
"Running: Retry the body up to N times : Body : End",
"Running: Retry the body up to N times : Body : Start",
"Running: Retry the body up to N times : Body : End",
"Running: Retry the body up to N times : Body : Start",
"Running: Retry the body up to N times : Body : End",
"Running: Retry the body up to N times : End",
"[Workflow] Retry the body up to N times : Start",
"[Workflow] retry {",
"[Workflow] } //retry",
"[Workflow] retry {",
"[Workflow] } //retry",
"[Workflow] retry {",
"[Workflow] } //retry",
"[Workflow] Retry the body up to N times : End",
}) {
idx = log.indexOf(msg, idx + 1);
assertTrue(msg + " not found", idx != -1);
Expand Down
Expand Up @@ -40,6 +40,7 @@
* @author Kohsuke Kawaguchi
*/
public class StepAtomNode extends AtomNode implements StepNode {

private final String descriptorId;

// once we successfully convert descriptorId to a real instance, cache that
Expand Down Expand Up @@ -70,4 +71,10 @@ protected String getTypeDisplayName() {
StepDescriptor d = getDescriptor();
return d!=null ? d.getDisplayName() : descriptorId;
}

@Override
protected String getTypeFunctionName() {
StepDescriptor d = getDescriptor();
return d != null ? d.getFunctionName() : descriptorId;
}
}
Expand Up @@ -37,6 +37,17 @@ protected String getTypeDisplayName() {
return getStartNode().getStepName() + (isBody?" : Body":"") + " : End";
}

@Override
protected String getTypeFunctionName() {
StepDescriptor d = getDescriptor();
boolean isBody = getStartNode().isBody();
if (isBody) {
return "} //" + (d != null ? d.getFunctionName() : getStartNode().getStepName());
} else {
return getStartNode().getStepName() + " : End";
}
}

@Override
public StepDescriptor getDescriptor() {
return getStartNode().getDescriptor();
Expand Down
Expand Up @@ -47,6 +47,16 @@ protected String getTypeDisplayName() {
return getStepName() + (isBody() ?" : Body":"") + " : Start";
}

@Override
protected String getTypeFunctionName() {
StepDescriptor d = getDescriptor();
if (isBody()) {
return (d != null ? d.getFunctionName() : descriptorId) + " {";
} else {
return getStepName() + " : Start";
}
}

public boolean isBody() {
return getAction(BodyInvocationAction.class)!=null;
}
Expand Down

0 comments on commit e955d74

Please sign in to comment.