Skip to content

Commit

Permalink
e2e: execute crc setup as single command
Browse files Browse the repository at this point in the history
Progress bar in stdout while bundle downloads during crc setup causes
the entire testsuite remain stuck at that point. Circumvent this by
executing `crc setup` as a 'single' command outside of the current
shell environment.
  • Loading branch information
jsliacan authored and openshift-merge-robot committed Jan 19, 2023
1 parent 4418f9f commit 1dfd276
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/e2e/features/basic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Feature: Basic test
# Request start with monitoring stack
* setting config property "enable-cluster-monitoring" to value "true" succeeds
* setting config property "memory" to value "16000" succeeds
Given executing crc setup command succeeds
Given executing single crc setup command succeeds
When starting CRC with default bundle succeeds
Then stdout should contain "Started the OpenShift cluster"
# Check if user can copy-paste login details for developer and kubeadmin users
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/features/cert_rotation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Certificate rotation test
an app and check its accessibility.

Background: Setup CRC and rewind the clock forward
When executing crc setup command succeeds
When executing single crc setup command succeeds
And executing "sudo timedatectl set-ntp off" succeeds
Then executing "sudo date -s '13 month'" succeeds
And with up to "10" retries with wait period of "1s" command "virsh --readonly -c qemu:///system capabilities" output matches "^<capabilities>"
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/features/config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Feature: Test configuration settings

@linux @darwin @windows
Scenario: CRC config checks (bundle version)
Given executing crc setup command succeeds
Given executing single crc setup command succeeds
When setting config property "bundle" to value "current bundle" succeeds
And "JSON" config file "crc.json" in CRC home folder contains key "bundle" with value matching "current bundle"
And setting config property "bundle" to value "/path/to/nonexistent/bundle/crc_hypervisor_version.tar.xz" fails
Expand Down Expand Up @@ -110,15 +110,15 @@ Feature: Test configuration settings

@linux
Scenario: Missing CRC setup
Given executing crc setup command succeeds
Given executing single crc setup command succeeds
When executing "rm ~/.crc/bin/crc-driver-libvirt" succeeds
Then starting CRC with default bundle fails
And stderr should contain "Preflight checks failed during `crc start`, please try to run `crc setup` first in case you haven't done so yet"

@linux
Scenario: Check network setup and destroy it, then check again
When removing file "crc.json" from CRC home folder succeeds
And executing crc setup command succeeds
And executing single crc setup command succeeds
And executing "sudo virsh net-list --name" succeeds
Then stdout contains "crc"
When executing "sudo virsh net-undefine crc && sudo virsh net-destroy crc" succeeds
Expand All @@ -129,7 +129,7 @@ Feature: Test configuration settings
Scenario: Running `crc setup` with checks enabled restores destroyed network
When executing "crc config set skip-check-crc-network false" succeeds
And executing "crc config set skip-check-crc-network-active false" succeeds
Then executing crc setup command succeeds
Then executing single crc setup command succeeds
And executing "sudo virsh net-list --name" succeeds
And stdout contains "crc"

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/features/proxy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Behind proxy test
* executing "podman run --name squid -d -p 3128:3128 quay.io/crcont/squid" succeeds

Scenario: Start CRC behind proxy
Given executing crc setup command succeeds
Given executing single crc setup command succeeds
And executing "crc config set http-proxy http://192.168.130.1:3128" succeeds
Then executing "crc config set https-proxy http://192.168.130.1:3128" succeeds
When starting CRC with default bundle succeeds
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func EnsureCRCIsRunningSucceedsOrFails(expected string) error {
return err
}

err = ExecuteCommandWithExpectedExitStatus("setup", expected) // uses the right bundle argument if needed
err = ExecuteSingleCommandWithExpectedExitStatus("setup", expected) // uses the right bundle argument if needed
if err != nil {
return err
}
Expand Down

0 comments on commit 1dfd276

Please sign in to comment.