@@ -351,17 +351,18 @@ func TestBuildApprovalRequestObject(t *testing.T) {
351351 {
352352 name : "should create ClusterApprovalRequest when namespace is empty" ,
353353 namespacedName : types.NamespacedName {
354- Name : "test-approval-request" ,
354+ Name : "test-before- approval-request" ,
355355 Namespace : "" ,
356356 },
357357 stageName : "test-stage" ,
358358 updateRunName : "test-update-run" ,
359359 want : & placementv1beta1.ClusterApprovalRequest {
360360 ObjectMeta : metav1.ObjectMeta {
361- Name : "test-approval-request" ,
361+ Name : "test-before- approval-request" ,
362362 Labels : map [string ]string {
363363 placementv1beta1 .TargetUpdatingStageNameLabel : "test-stage" ,
364364 placementv1beta1 .TargetUpdateRunLabel : "test-update-run" ,
365+ placementv1beta1 .TargetStageTaskLabel : "before" ,
365366 placementv1beta1 .IsLatestUpdateRunApprovalLabel : "true" ,
366367 },
367368 },
@@ -374,18 +375,19 @@ func TestBuildApprovalRequestObject(t *testing.T) {
374375 {
375376 name : "should create namespaced ApprovalRequest when namespace is provided" ,
376377 namespacedName : types.NamespacedName {
377- Name : "test-approval-request" ,
378+ Name : "test-after- approval-request" ,
378379 Namespace : "test-namespace" ,
379380 },
380381 stageName : "test-stage" ,
381382 updateRunName : "test-update-run" ,
382383 want : & placementv1beta1.ApprovalRequest {
383384 ObjectMeta : metav1.ObjectMeta {
384- Name : "test-approval-request" ,
385+ Name : "test-after- approval-request" ,
385386 Namespace : "test-namespace" ,
386387 Labels : map [string ]string {
387388 placementv1beta1 .TargetUpdatingStageNameLabel : "test-stage" ,
388389 placementv1beta1 .TargetUpdateRunLabel : "test-update-run" ,
390+ placementv1beta1 .TargetStageTaskLabel : "after" ,
389391 placementv1beta1 .IsLatestUpdateRunApprovalLabel : "true" ,
390392 },
391393 },
@@ -948,6 +950,7 @@ func TestCalculateMaxConcurrencyValue(t *testing.T) {
948950func TestCheckBeforeStageTasksStatus_NegativeCases (t * testing.T ) {
949951 stageName := "stage-0"
950952 testUpdateRunName = "test-update-run"
953+ stageTask := "before"
951954 approvalRequestName := fmt .Sprintf (placementv1beta1 .BeforeStageApprovalTaskNameFmt , testUpdateRunName , stageName )
952955 tests := []struct {
953956 name string
@@ -1035,6 +1038,7 @@ func TestCheckBeforeStageTasksStatus_NegativeCases(t *testing.T) {
10351038 Labels : map [string ]string {
10361039 placementv1beta1 .TargetUpdatingStageNameLabel : stageName ,
10371040 placementv1beta1 .TargetUpdateRunLabel : testUpdateRunName ,
1041+ placementv1beta1 .TargetStageTaskLabel : stageTask ,
10381042 placementv1beta1 .IsLatestUpdateRunApprovalLabel : "true" ,
10391043 },
10401044 },
@@ -1091,6 +1095,7 @@ func TestCheckBeforeStageTasksStatus_NegativeCases(t *testing.T) {
10911095 Labels : map [string ]string {
10921096 placementv1beta1 .TargetUpdatingStageNameLabel : stageName ,
10931097 placementv1beta1 .TargetUpdateRunLabel : testUpdateRunName ,
1098+ placementv1beta1 .TargetStageTaskLabel : stageTask ,
10941099 placementv1beta1 .IsLatestUpdateRunApprovalLabel : "true" ,
10951100 },
10961101 },
@@ -1147,6 +1152,7 @@ func TestCheckBeforeStageTasksStatus_NegativeCases(t *testing.T) {
11471152 Labels : map [string ]string {
11481153 placementv1beta1 .TargetUpdatingStageNameLabel : stageName ,
11491154 placementv1beta1 .TargetUpdateRunLabel : testUpdateRunName ,
1155+ placementv1beta1 .TargetStageTaskLabel : stageTask ,
11501156 placementv1beta1 .IsLatestUpdateRunApprovalLabel : "true" ,
11511157 },
11521158 },
0 commit comments