From 2ea82e1a6e3b28583cd9d2636b7cbbcfe49a41a1 Mon Sep 17 00:00:00 2001 From: Luke Massa Date: Mon, 12 Aug 2024 12:52:08 -0400 Subject: [PATCH 1/3] Log error on cleanup in e2e --- e2e/e2e.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/e2e/e2e.go b/e2e/e2e.go index 5c19d501b0..0c2247018c 100644 --- a/e2e/e2e.go +++ b/e2e/e2e.go @@ -114,7 +114,12 @@ func (t *E2ETester) Start(ctx context.Context) (*E2EResult, error) { log.Printf("created pull request %s", url) // defer closing pull request and delete remote branch - defer cleanUp(ctx, t, pullId, branchName) // nolint: errcheck + defer func() { + err := cleanUp(ctx, t, pullId, branchName) + if err != nil { + log.Printf("Failed to cleanup: %v", err) + } + }() // wait for atlantis to respond to webhook and autoplan. time.Sleep(2 * time.Second) From 27c6e0eadffdee5636c7f574603aee53909009cc Mon Sep 17 00:00:00 2001 From: Luke Massa Date: Mon, 12 Aug 2024 12:58:59 -0400 Subject: [PATCH 2/3] Add intentional error --- e2e/e2e.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/e2e.go b/e2e/e2e.go index 0c2247018c..7c68aca7f0 100644 --- a/e2e/e2e.go +++ b/e2e/e2e.go @@ -175,5 +175,5 @@ func cleanUp(ctx context.Context, t *E2ETester, pullRequestNumber int, branchNam } log.Printf("deleted branch %s", deleteBranchName) - return nil + return fmt.Errorf("INTENTIONAL ERROR") } From 94b2463a4480149103d8b4da576b9dd82c0df9a7 Mon Sep 17 00:00:00 2001 From: Luke Massa Date: Mon, 12 Aug 2024 13:02:09 -0400 Subject: [PATCH 3/3] Revert "Add intentional error" This reverts commit 41b8f26c038c4fba1abf51bc710b42fc4a64c1e5. --- e2e/e2e.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/e2e.go b/e2e/e2e.go index 7c68aca7f0..0c2247018c 100644 --- a/e2e/e2e.go +++ b/e2e/e2e.go @@ -175,5 +175,5 @@ func cleanUp(ctx context.Context, t *E2ETester, pullRequestNumber int, branchNam } log.Printf("deleted branch %s", deleteBranchName) - return fmt.Errorf("INTENTIONAL ERROR") + return nil }