Skip to content

Commit

Permalink
Move to env variable opt out
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Levick <[email protected]>
  • Loading branch information
rylev committed Jul 24, 2024
1 parent 328e990 commit 190f313
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ jobs:
- name: Run Integration Tests
run: |
make test-integration
env:
SPIN_CONFORMANCE_TESTS_DOCKER_OPT_OUT: true
# Only run integration tests on macOS as they will be run on ubuntu separately
if: ${{ matrix.runner == 'macos-14' }}

Expand Down
12 changes: 4 additions & 8 deletions tests/conformance-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ pub fn run_test(
services.push("tcp-echo");
}
conformance_tests::config::Precondition::Redis => {
if is_docker_installed() {
if should_run_docker_based_tests() {
services.push("redis")
} else {
// Skip the test if docker is not installed.
return Ok(());
}
}
conformance_tests::config::Precondition::Mqtt => {
if is_docker_installed() {
if should_run_docker_based_tests() {
services.push("mqtt")
} else {
// Skip the test if docker is not installed.
Expand Down Expand Up @@ -73,10 +73,6 @@ pub fn run_test(
}

/// Whether or not docker is installed on the system.
fn is_docker_installed() -> bool {
std::process::Command::new("docker")
.arg("--version")
.output()
.map(|output| output.status.success())
.unwrap_or(false)
fn should_run_docker_based_tests() -> bool {
std::env::var("SPIN_CONFORMANCE_TESTS_DOCKER_OPT_OUT").is_err()
}

0 comments on commit 190f313

Please sign in to comment.