Skip to content

Commit

Permalink
Reusing controller methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz Filho committed Oct 25, 2023
1 parent 66ade3c commit 96a6711
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions controllers/leveltriggered/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,13 @@ func TestReconcile(t *testing.T) {
g.Eventually(func() bool {
p := getPipeline(ctx, g, client.ObjectKeyFromObject(pipeline))

for _, env := range p.Status.Environments {
for _, target := range env.Targets {
if target.Revision != versionToPromote {
return false
}
for _, env := range p.Spec.Environments {
if !checkAllTargetsRunRevision(p.Status.Environments[env.Name], versionToPromote) {
return false
}

if !checkAllTargetsAreReady(p.Status.Environments[env.Name]) {
return false
}
}

Expand All @@ -229,11 +231,9 @@ func TestReconcile(t *testing.T) {
g.Eventually(func() bool {
p := getPipeline(ctx, g, client.ObjectKeyFromObject(pipeline))

for _, env := range p.Status.Environments {
for _, target := range env.Targets {
if target.Revision != "v1.0.2" {
return false
}
for _, env := range p.Spec.Environments {
if !checkAllTargetsRunRevision(p.Status.Environments[env.Name], "v1.0.2") {
return false
}
}

Expand Down

0 comments on commit 96a6711

Please sign in to comment.