From fd7313a318cccdaada0215d94659225769b0235e Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Sun, 22 Feb 2026 19:56:47 +0100 Subject: [PATCH] fix CI: skip prereq check for mock backend, add bash to opensuse - Add KARAPACE_SKIP_PREREQS=1 env var check to skip runtime prerequisite checks (user namespaces, fuse-overlayfs) when testing with mock backend - Set KARAPACE_SKIP_PREREQS=1 in CLI integration test helper - Add bash to opensuse/tumbleweed container deps (required by dtolnay/rust-toolchain action) --- .github/workflows/ci.yml | 4 ++-- crates/karapace-cli/src/main.rs | 2 +- crates/karapace-cli/tests/cli_integration.rs | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2cdb45..8d0a5d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: run: dnf install -y gcc make curl - name: Install build deps (openSUSE) if: matrix.os == 'opensuse' - run: zypper install -y gcc make curl gzip tar xz + run: zypper install -y gcc make curl gzip tar xz bash - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.RUST_TOOLCHAIN }} @@ -136,7 +136,7 @@ jobs: setup: "dnf install -y gcc make curl fuse-overlayfs fuse3 crun" - os: opensuse container: opensuse/tumbleweed:latest - setup: "zypper install -y gcc make curl fuse-overlayfs gzip tar xz crun" + setup: "zypper install -y gcc make curl fuse-overlayfs gzip tar xz bash crun" container: ${{ matrix.container }} steps: - uses: actions/checkout@v4 diff --git a/crates/karapace-cli/src/main.rs b/crates/karapace-cli/src/main.rs index 16f7211..b75c5d7 100644 --- a/crates/karapace-cli/src/main.rs +++ b/crates/karapace-cli/src/main.rs @@ -203,7 +203,7 @@ fn main() -> ExitCode { | Commands::Exec { .. } | Commands::Rebuild { .. } ); - if needs_runtime { + if needs_runtime && std::env::var("KARAPACE_SKIP_PREREQS").as_deref() != Ok("1") { let missing = karapace_runtime::check_namespace_prereqs(); if !missing.is_empty() { eprintln!("error: {}", karapace_runtime::format_missing(&missing)); diff --git a/crates/karapace-cli/tests/cli_integration.rs b/crates/karapace-cli/tests/cli_integration.rs index 4e1c83a..f782a06 100644 --- a/crates/karapace-cli/tests/cli_integration.rs +++ b/crates/karapace-cli/tests/cli_integration.rs @@ -6,7 +6,10 @@ use std::process::Command; fn karapace_bin() -> Command { - Command::new(env!("CARGO_BIN_EXE_karapace")) + let mut cmd = Command::new(env!("CARGO_BIN_EXE_karapace")); + // Skip runtime prerequisite checks — mock backend does not need user namespaces + cmd.env("KARAPACE_SKIP_PREREQS", "1"); + cmd } fn temp_store() -> tempfile::TempDir {