File tree 1 file changed +29
-0
lines changed
src/test/java/org/jenkinsci/plugins/workflow/support/steps
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 82
82
import static org .hamcrest .Matchers .*;
83
83
import org .jboss .marshalling .ObjectResolver ;
84
84
import org .jenkinsci .plugins .durabletask .FileMonitoringTask ;
85
+ import org .jenkinsci .plugins .workflow .actions .ExecutorAction ;
85
86
import org .jenkinsci .plugins .workflow .actions .LogAction ;
86
87
import org .jenkinsci .plugins .workflow .actions .QueueItemAction ;
87
88
import org .jenkinsci .plugins .workflow .actions .WorkspaceAction ;
@@ -916,4 +917,32 @@ private static class FallbackAuthenticator extends QueueItemAuthenticator {
916
917
}
917
918
}
918
919
920
+ @ Issue ("JENKINS-44193" )
921
+ @ Test
922
+ public void executionActionIsPresent () throws Exception {
923
+ story .addStep (new Statement () {
924
+ @ Override public void evaluate () throws Throwable {
925
+ WorkflowJob p = story .j .jenkins .createProject (WorkflowJob .class , "executionActionIsPresent" );
926
+ p .setDefinition (new CpsFlowDefinition (
927
+ "node() {\n " +
928
+ " echo \" 123\" \n " +
929
+ "}" , true ));
930
+ WorkflowRun b = story .j .assertBuildStatusSuccess (p .scheduleBuild2 (0 ));
931
+
932
+ // Wait until the build completes.
933
+ story .j .waitForCompletion (b );
934
+
935
+ FlowGraphWalker walker = new FlowGraphWalker (b .getExecution ());
936
+ List <ExecutorAction > actions = new ArrayList <ExecutorAction >();
937
+ for (FlowNode n : walker ) {
938
+ ExecutorAction a = n .getAction (ExecutorAction .class );
939
+ if (a != null ) {
940
+ actions .add (a );
941
+ }
942
+ }
943
+ assertEquals (1 , actions .size ());
944
+ }
945
+ });
946
+ }
947
+
919
948
}
You can’t perform that action at this time.
0 commit comments