@@ -29,12 +29,19 @@ import (
2929 th "github.com/tektoncd/pipeline/pkg/reconciler/testing"
3030 corev1 "k8s.io/api/core/v1"
3131 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
32+ knativetest "knative.dev/pkg/test"
3233)
3334
34- func TestPipelineRun_OneChildPipelineRunFromPipelineSpec (t * testing.T ) {
35- ctx , cancel , c , namespace := setupPinP (t )
35+ func TestPipelineRun_PinP_OneChildPipelineRunFromPipelineSpec (t * testing.T ) {
36+ t .Parallel ()
37+ ctx := t .Context ()
38+ ctx , cancel := context .WithCancel (ctx )
3639 defer cancel ()
37- defer tearDownOptDump (ctx , t , c , namespace , true )
40+ c , namespace := setup (ctx , t , requireAnyGate (map [string ]string {
41+ "enable-api-fields" : "alpha" ,
42+ }))
43+ knativetest .CleanupOnInterrupt (func () { tearDown (ctx , t , c , namespace ) }, t .Logf )
44+ defer tearDown (ctx , t , c , namespace )
3845
3946 // GIVEN
4047 t .Logf ("Setting up test resources for one child PipelineRun from PipelineSpec in namespace %q" , namespace )
@@ -100,10 +107,16 @@ func assertPinP(
100107 checkAnnotationPropagationToChildPipelineRun (ctx , t , c , namespace , directParentPrName , actualCpr )
101108}
102109
103- func TestPipelineRun_TwoChildPipelineRunsMixedTasks (t * testing.T ) {
104- ctx , cancel , c , namespace := setupPinP (t )
110+ func TestPipelineRun_PinP_TwoChildPipelineRunsMixedTasks (t * testing.T ) {
111+ t .Parallel ()
112+ ctx := t .Context ()
113+ ctx , cancel := context .WithCancel (ctx )
105114 defer cancel ()
106- defer tearDownOptDump (ctx , t , c , namespace , true )
115+ c , namespace := setup (ctx , t , requireAnyGate (map [string ]string {
116+ "enable-api-fields" : "alpha" ,
117+ }))
118+ knativetest .CleanupOnInterrupt (func () { tearDown (ctx , t , c , namespace ) }, t .Logf )
119+ defer tearDown (ctx , t , c , namespace )
107120
108121 // GIVEN
109122 t .Logf ("Setting up test resources for two child PipelineRuns (mixed tasks) in namespace %q" , namespace )
@@ -124,10 +137,16 @@ func TestPipelineRun_TwoChildPipelineRunsMixedTasks(t *testing.T) {
124137 assertEvents (ctx , t , expectedEventsAmount , expectedKinds , c , namespace )
125138}
126139
127- func TestPipelineRun_TwoLevelDeepNestedChildPipelineRuns (t * testing.T ) {
128- ctx , cancel , c , namespace := setupPinP (t )
140+ func TestPipelineRun_PinP_TwoLevelDeepNestedChildPipelineRuns (t * testing.T ) {
141+ t .Parallel ()
142+ ctx := t .Context ()
143+ ctx , cancel := context .WithCancel (ctx )
129144 defer cancel ()
130- defer tearDownOptDump (ctx , t , c , namespace , true )
145+ c , namespace := setup (ctx , t , requireAnyGate (map [string ]string {
146+ "enable-api-fields" : "alpha" ,
147+ }))
148+ knativetest .CleanupOnInterrupt (func () { tearDown (ctx , t , c , namespace ) }, t .Logf )
149+ defer tearDown (ctx , t , c , namespace )
131150
132151 // GIVEN
133152 t .Logf ("Setting up test resources for two level deep nested child PipelineRuns in namespace %q" , namespace )
0 commit comments