Skip to content

Commit

Permalink
Flip confirm logic in cip/cip-auditor e2e MakeSyncContext() calls
Browse files Browse the repository at this point in the history
Flag changed from `dry-run` to `confirm` so we flip the logic in
MakeSyncContext(). Prior to this, test registries were not cleared
as the delete invocation was running in dry run (or confirm = false).

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
  • Loading branch information
puerco committed Sep 14, 2021
1 parent ce2f8bf commit a87e90e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test-e2e/cip-auditor/cip-auditor-e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (t *E2ETest) clearRepositories() error {
{Registries: t.Registries},
},
10,
false,
true,
true)
if err != nil {
return err
Expand Down
15 changes: 6 additions & 9 deletions test-e2e/cip/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,14 @@ func main() {
// Loop through each e2e test case.
for _, t := range ts {
fmt.Printf("\n===> Running e2e test '%s'...\n", t.Name)
err := testSetup(*repoRootPtr, &t)
if err != nil {
if err := testSetup(*repoRootPtr, &t); err != nil {
logrus.Fatalf("error with test setup: %q", err)
}

fmt.Println("checking snapshots BEFORE promotion:")
for _, snapshot := range t.Snapshots {
err := checkSnapshot(snapshot.Name, snapshot.Before, *repoRootPtr, t.Registries)
if err != nil {
logrus.Fatalf("error checking snapshot for %s: %q", snapshot.Name, err)
if err := checkSnapshot(snapshot.Name, snapshot.Before, *repoRootPtr, t.Registries); err != nil {
logrus.Fatalf("error checking snapshot before promotion for %s: %q", snapshot.Name, err)
}
}

Expand Down Expand Up @@ -141,7 +139,7 @@ func checkSnapshot(

func testSetup(repoRoot string, t *E2ETest) error {
if err := t.clearRepositories(); err != nil {
return err
return errors.Wrap(err, "cleaning test repository")
}

goldenPush := fmt.Sprintf("%s/test-e2e/golden-images/push-golden.sh", repoRoot)
Expand All @@ -156,7 +154,6 @@ func testSetup(repoRoot string, t *E2ETest) error {
std, err := cmd.RunSuccessOutput()
fmt.Println(std.Output())
fmt.Println(std.Error())

return err
}

Expand Down Expand Up @@ -249,10 +246,10 @@ func (t *E2ETest) clearRepositories() error {
{Registries: t.Registries},
},
10,
false,
true,
true)
if err != nil {
return err
return errors.Wrap(err, "trying to create sync context")
}

sc.ReadRegistries(
Expand Down

0 comments on commit a87e90e

Please sign in to comment.