Skip to content

Commit

Permalink
fix when fixture.Install logs 'ignoring AGENT_KEEP_INSTALLED...' (#3380
Browse files Browse the repository at this point in the history
…) (#3388)

(cherry picked from commit 3372e6f)

Co-authored-by: Anderson Queiroz <[email protected]>
  • Loading branch information
mergify[bot] and AndersonQ authored Sep 27, 2023
1 parent a7b2514 commit 5a033dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/testing/fixture_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@ func (f *Fixture) Install(ctx context.Context, installOpts *InstallOpts, opts ..

// environment variable AGENT_KEEP_INSTALLED=true will skip the uninstall
// useful to debug the issue with the Elastic Agent
if keepInstalled() && f.t.Failed() {
f.t.Logf("skipping uninstall; AGENT_KEEP_INSTALLED=true")
if f.t.Failed() && keepInstalled() {
f.t.Logf("skipping uninstall; test failed and AGENT_KEEP_INSTALLED=true")
return
} else {
}

if keepInstalled() {
f.t.Logf("ignoring AGENT_KEEP_INSTALLED=true as test succeeded, " +
"keeping the agent installed will jeperdise other tests")
"keeping the agent installed will jeopardise other tests")
}

out, err := f.Uninstall(ctx, &UninstallOpts{Force: true, UninstallToken: f.uninstallToken})
Expand Down

0 comments on commit 5a033dd

Please sign in to comment.