Skip to content

Commit b233123

Browse files
Jakub Sliacanadrianriobo
authored andcommitted
e2e: move cleanup actions to Scenario After hook
1 parent d600b47 commit b233123

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

test/e2e/features/basic.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ Feature: Basic test
5757
And ensuring user is logged in succeeds
5858
And executing "oc get pods -n openshift-monitoring" succeeds
5959
Then stdout matches ".*cluster-monitoring-operator-\w+-\w+\ *2/2\ *Running.*"
60-
And unsetting config property "enable-cluster-monitoring" succeeds
61-
And unsetting config property "memory" succeeds
6260
# stop
6361
When executing "crc stop"
6462
Then stdout should match "(.*)[Ss]topped the instance"

test/e2e/testsuite/testsuite.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,18 @@ func InitializeScenario(s *godog.ScenarioContext) {
235235
fmt.Println(err)
236236
os.Exit(1)
237237
}
238+
239+
err = crcCmd.UnsetConfigPropertySucceedsOrFails("enable-cluster-monitoring", "succeeds") // unsetting property that is not set gives 0 exitcode, so this works
240+
if err != nil {
241+
fmt.Println(err)
242+
os.Exit(1)
243+
}
244+
245+
err = crcCmd.UnsetConfigPropertySucceedsOrFails("memory", "succeeds") // unsetting property that is not set gives 0 exitcode, so this works
246+
if err != nil {
247+
fmt.Println(err)
248+
os.Exit(1)
249+
}
238250
}
239251

240252
}

0 commit comments

Comments
 (0)