@@ -2290,11 +2290,17 @@ func TestPipelineTasksExecutionStatus(t *testing.T) {
22902290			TaskRef : & TaskRef {Name : "bar-task" },
22912291			Params : []Param {{
22922292				Name : "foo-status" , Value : ArrayOrString {Type : ParamTypeString , StringVal : "$(tasks.foo.status)" },
2293+ 			}, {
2294+ 				Name : "tasks-status" , Value : ArrayOrString {Type : ParamTypeString , StringVal : "$(tasks.status)" },
22932295			}},
2294- 			WhenExpressions : WhenExpressions {WhenExpression {
2296+ 			WhenExpressions : WhenExpressions {{
22952297				Input :    "$(tasks.foo.status)" ,
22962298				Operator : selection .In ,
22972299				Values :   []string {"Failure" },
2300+ 			}, {
2301+ 				Input :    "$(tasks.status)" ,
2302+ 				Operator : selection .In ,
2303+ 				Values :   []string {"Success" },
22982304			}},
22992305		}},
23002306	}, {
@@ -2350,12 +2356,25 @@ func TestPipelineTasksExecutionStatus(t *testing.T) {
23502356			}},
23512357		}},
23522358		expectedError : * apis .ErrGeneric ("" ).Also (& apis.FieldError {
2353- 			Message : `invalid value: pipeline tasks can not refer to execution status of any other pipeline task` ,
2359+ 			Message : `invalid value: pipeline tasks can not refer to execution status of any other pipeline task or aggregate status of tasks ` ,
23542360			Paths :   []string {"tasks[0].params[bar-status].value" },
23552361		}).Also (& apis.FieldError {
2356- 			Message : `invalid value: when expressions in pipeline tasks can not refer to execution status of any other pipeline task` ,
2362+ 			Message : `invalid value: when expressions in pipeline tasks can not refer to execution status of any other pipeline task or aggregate status of tasks ` ,
23572363			Paths :   []string {"tasks[0].when[0]" },
23582364		}),
2365+ 	}, {
2366+ 		name : "invalid string variable in dag task accessing aggregate status of tasks" ,
2367+ 		tasks : []PipelineTask {{
2368+ 			Name :    "foo" ,
2369+ 			TaskRef : & TaskRef {Name : "foo-task" },
2370+ 			Params : []Param {{
2371+ 				Name : "tasks-status" , Value : ArrayOrString {Type : ParamTypeString , StringVal : "$(tasks.status)" },
2372+ 			}},
2373+ 		}},
2374+ 		expectedError : apis.FieldError {
2375+ 			Message : `invalid value: pipeline tasks can not refer to execution status of any other pipeline task or aggregate status of tasks` ,
2376+ 			Paths :   []string {"tasks[0].params[tasks-status].value" },
2377+ 		},
23592378	}, {
23602379		name : "invalid variable concatenated with extra string in dag task accessing pipelineTask status" ,
23612380		tasks : []PipelineTask {{
@@ -2366,7 +2385,7 @@ func TestPipelineTasksExecutionStatus(t *testing.T) {
23662385			}},
23672386		}},
23682387		expectedError : apis.FieldError {
2369- 			Message : `invalid value: pipeline tasks can not refer to execution status of any other pipeline task` ,
2388+ 			Message : `invalid value: pipeline tasks can not refer to execution status of any other pipeline task or aggregate status of tasks ` ,
23702389			Paths :   []string {"tasks[0].params[bar-status].value" },
23712390		},
23722391	}, {
@@ -2379,9 +2398,22 @@ func TestPipelineTasksExecutionStatus(t *testing.T) {
23792398			}},
23802399		}},
23812400		expectedError : apis.FieldError {
2382- 			Message : `invalid value: pipeline tasks can not refer to execution status of any other pipeline task` ,
2401+ 			Message : `invalid value: pipeline tasks can not refer to execution status of any other pipeline task or aggregate status of tasks ` ,
23832402			Paths :   []string {"tasks[0].params[bar-status].value" },
23842403		},
2404+ 	}, {
2405+ 		name : "invalid array variable in dag task accessing aggregate tasks status" ,
2406+ 		tasks : []PipelineTask {{
2407+ 			Name :    "foo" ,
2408+ 			TaskRef : & TaskRef {Name : "foo-task" },
2409+ 			Params : []Param {{
2410+ 				Name : "tasks-status" , Value : ArrayOrString {Type : ParamTypeArray , ArrayVal : []string {"$(tasks.status)" }},
2411+ 			}},
2412+ 		}},
2413+ 		expectedError : apis.FieldError {
2414+ 			Message : `invalid value: pipeline tasks can not refer to execution status of any other pipeline task or aggregate status of tasks` ,
2415+ 			Paths :   []string {"tasks[0].params[tasks-status].value" },
2416+ 		},
23852417	}, {
23862418		name : "invalid string variable in finally accessing missing pipelineTask status" ,
23872419		finalTasks : []PipelineTask {{
0 commit comments