@@ -49,16 +49,17 @@ func (s *ExecutorPluginsSuite) TestTemplateExecutor() {
4949 assert .Contains (t , spec .Volumes [2 ].Name , "kube-api-access-" )
5050 assert .Equal (t , "argo-workflows-agent-ca-certificates" , spec .Volumes [3 ].Name )
5151
52- require .Len (t , spec .Containers , 2 )
52+ require .Len (t , spec .Containers , 3 )
5353 {
54- plug := spec .Containers [0 ]
54+ plug := requireFindContainerByName (t , spec .Containers , "hello-executor-plugin" )
55+ require .NotNil (t , plug )
5556 require .Equal (t , "hello-executor-plugin" , plug .Name )
5657 require .Len (t , plug .VolumeMounts , 2 )
5758 assert .Equal (t , "var-run-argo" , plug .VolumeMounts [0 ].Name )
5859 assert .Contains (t , plug .VolumeMounts [1 ].Name , "kube-api-access-" )
5960 }
6061 {
61- agent := spec .Containers [ 1 ]
62+ agent := requireFindContainerByName ( t , spec .Containers , "main" )
6263 require .Equal (t , "main" , agent .Name )
6364 require .Len (t , agent .VolumeMounts , 3 )
6465 assert .Equal (t , "var-run-argo" , agent .VolumeMounts [0 ].Name )
@@ -83,6 +84,34 @@ func (s *ExecutorPluginsSuite) TestTemplateExecutor() {
8384 })
8485}
8586
87+ func (s * ExecutorPluginsSuite ) TestCompressedTemplateExecutor_WorkflowTaskSetIsProperlyCleaned () {
88+ s .Given ().
89+ Workflow ("@testdata/plugins/executor/massive-executor-workflow.yaml" ).
90+ When ().
91+ SubmitWorkflow ().
92+ WaitForWorkflow (fixtures .ToBeSucceeded ).
93+ Then ().
94+ ExpectWorkflowCompressed ().
95+ ExpectWorkflowTaskSet (func (t * testing.T , wfts * wfv1.WorkflowTaskSet ) {
96+ assert .NotNil (t , wfts )
97+ assert .Empty (t , wfts .Status .Nodes )
98+ assert .Empty (t , wfts .Spec .Tasks )
99+ assert .Equal (t , "true" , wfts .Labels [common .LabelKeyCompleted ])
100+ })
101+ }
102+
86103func TestExecutorPluginsSuite (t * testing.T ) {
87104 suite .Run (t , new (ExecutorPluginsSuite ))
88105}
106+
107+ func requireFindContainerByName (t * testing.T , containers []apiv1.Container , name string ) * apiv1.Container {
108+ var result * apiv1.Container
109+ for _ , container := range containers {
110+ if container .Name == name {
111+ result = & container
112+ break
113+ }
114+ }
115+ require .NotNil (t , result , "could not find container %s" , name )
116+ return result
117+ }
0 commit comments