Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-api</artifactId>
<version>2.30-beta-1</version>
<version>2.30-rc836.77211e4670e0</version> <!-- TODO https://github.com/jenkinsci/workflow-api-plugin/pull/77 -->
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback;
import org.jenkinsci.plugins.workflow.steps.StepContext;
import org.jenkinsci.plugins.workflow.steps.durable_task.Messages;
import org.jenkinsci.plugins.workflow.actions.ExecutorAction;
import org.jenkinsci.plugins.workflow.support.actions.WorkspaceActionImpl;
import org.jenkinsci.plugins.workflow.support.concurrent.Timeout;
import org.kohsuke.accmod.Restricted;
Expand Down Expand Up @@ -719,6 +720,7 @@ private final class PlaceholderExecutable implements ContinuableExecutable {
FlowNode flowNode = context.get(FlowNode.class);
if (flowNode != null) {
flowNode.addAction(new WorkspaceActionImpl(workspace, flowNode));
flowNode.addAction(new ExecutorAction(exec));
}
listener.getLogger().println("Running on " + ModelHyperlinkNote.encodeTo(node) + " in " + workspace);
context.newBodyInvoker()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
import static org.hamcrest.Matchers.*;
import org.jboss.marshalling.ObjectResolver;
import org.jenkinsci.plugins.durabletask.FileMonitoringTask;
import org.jenkinsci.plugins.workflow.actions.ExecutorAction;
import org.jenkinsci.plugins.workflow.actions.LogAction;
import org.jenkinsci.plugins.workflow.actions.QueueItemAction;
import org.jenkinsci.plugins.workflow.actions.WorkspaceAction;
Expand Down Expand Up @@ -916,4 +917,32 @@ private static class FallbackAuthenticator extends QueueItemAuthenticator {
}
}

@Issue("JENKINS-44193")
@Test
public void executionActionIsPresent() throws Exception {
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "executionActionIsPresent");
p.setDefinition(new CpsFlowDefinition(
"node() {\n" +
" echo \"123\"\n" +
"}", true));
WorkflowRun b = story.j.assertBuildStatusSuccess(p.scheduleBuild2(0));

// Wait until the build completes.
story.j.waitForCompletion(b);

FlowGraphWalker walker = new FlowGraphWalker(b.getExecution());
List<ExecutorAction> actions = new ArrayList<ExecutorAction>();
for (FlowNode n : walker) {
ExecutorAction a = n.getAction(ExecutorAction.class);
if (a != null) {
actions.add(a);
}
}
assertEquals(1, actions.size());
}
});
}

}