@@ -30,10 +30,10 @@ const (
30
30
)
31
31
32
32
func TestReconcile (t * testing.T ) {
33
- g := testingutils .NewGomegaWithT (t )
34
33
ctx := context .Background ()
35
34
36
- t .Run ("sets cluster not found and cluster unready condition" , func (_ * testing.T ) {
35
+ t .Run ("sets cluster not found and cluster unready condition" , func (t * testing.T ) {
36
+ g := testingutils .NewGomegaWithT (t )
37
37
name := "pipeline-" + rand .String (5 )
38
38
clusterName := "cluster-" + rand .String (5 )
39
39
ns := testingutils .NewNamespace (ctx , g , k8sClient )
@@ -58,6 +58,7 @@ func TestReconcile(t *testing.T) {
58
58
})
59
59
60
60
t .Run ("sets reconciliation succeeded condition for remote cluster" , func (t * testing.T ) {
61
+ g := testingutils .NewGomegaWithT (t )
61
62
t .Skip ("remote clusters not supported yet" )
62
63
63
64
name := "pipeline-" + rand .String (5 )
@@ -79,7 +80,8 @@ func TestReconcile(t *testing.T) {
79
80
g .Expect (events [0 ].message ).To (ContainSubstring ("Updated pipeline" ))
80
81
})
81
82
82
- t .Run ("sets reconciliation succeeded condition without clusterRef" , func (_ * testing.T ) {
83
+ t .Run ("sets reconciliation succeeded condition without clusterRef" , func (t * testing.T ) {
84
+ g := testingutils .NewGomegaWithT (t )
83
85
name := "pipeline-" + rand .String (5 )
84
86
ns := testingutils .NewNamespace (ctx , g , k8sClient )
85
87
@@ -98,6 +100,7 @@ func TestReconcile(t *testing.T) {
98
100
})
99
101
100
102
t .Run ("app status is recorded faithfully" , func (t * testing.T ) {
103
+ g := testingutils .NewGomegaWithT (t )
101
104
name := "pipeline-" + rand .String (5 )
102
105
ns := testingutils .NewNamespace (ctx , g , k8sClient )
103
106
pipeline := newPipeline (ctx , g , name , ns .Name , nil )
@@ -126,6 +129,7 @@ func TestReconcile(t *testing.T) {
126
129
})
127
130
128
131
t .Run ("promotes revision to all environments" , func (t * testing.T ) {
132
+ g := testingutils .NewGomegaWithT (t )
129
133
mockStrategy := setStrategyRegistry (t , pipelineReconciler )
130
134
mockStrategy .EXPECT ().Handles (gomock .Any ()).Return (true ).AnyTimes ()
131
135
@@ -243,6 +247,7 @@ func TestReconcile(t *testing.T) {
243
247
})
244
248
245
249
t .Run ("sets PipelinePending condition" , func (t * testing.T ) {
250
+ g := testingutils .NewGomegaWithT (t )
246
251
mockStrategy := setStrategyRegistry (t , pipelineReconciler )
247
252
mockStrategy .EXPECT ().Handles (gomock .Any ()).Return (true ).AnyTimes ()
248
253
@@ -351,7 +356,7 @@ func getTargetStatus(g Gomega, pipeline *v1alpha1.Pipeline, envName string, targ
351
356
352
357
func checkCondition (ctx context.Context , g Gomega , n types.NamespacedName , conditionType string , status metav1.ConditionStatus , reason string ) {
353
358
pipeline := & v1alpha1.Pipeline {}
354
- assrt := g .Eventually ( func () metav1.Condition {
359
+ assrt := g .EventuallyWithOffset ( 1 , func () metav1.Condition {
355
360
err := k8sClient .Get (ctx , n , pipeline )
356
361
if err != nil {
357
362
return metav1.Condition {}
0 commit comments