From 46caa986bb7db4fcce5b746e4687bd71941ed07c Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Thu, 27 Mar 2025 10:47:49 +0800 Subject: [PATCH] ci: Skip tests depend on virtualization on riscv64 `VMContainerCapable` requires a present `kvm` device, which is not yet available in our RISC-V runners. Skipped related tests if it is running on `riscv-builder`. Signed-off-by: Ruoqing He --- .github/workflows/build-checks-preview-riscv64.yaml | 4 ++++ src/runtime/cmd/kata-runtime/kata-check_riscv64_test.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build-checks-preview-riscv64.yaml b/.github/workflows/build-checks-preview-riscv64.yaml index 25d11b741b..69f872d3f1 100644 --- a/.github/workflows/build-checks-preview-riscv64.yaml +++ b/.github/workflows/build-checks-preview-riscv64.yaml @@ -106,6 +106,10 @@ jobs: run: | XDG_RUNTIME_DIR=$(mktemp -d "/tmp/kata-tests-$USER.XXX" | tee >(xargs chmod 0700)) echo "XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}" >> "$GITHUB_ENV" + - name: Skip tests that depend on virtualization capable runners when needed + if: inputs.instance == 'riscv-builder' + run: | + echo "GITHUB_RUNNER_CI_NON_VIRT=true" >> "$GITHUB_ENV" - name: Running `${{ matrix.command }}` for ${{ matrix.component.name }} run: | cd ${{ matrix.component.path }} diff --git a/src/runtime/cmd/kata-runtime/kata-check_riscv64_test.go b/src/runtime/cmd/kata-runtime/kata-check_riscv64_test.go index 28e419a2a2..ce76915ac9 100644 --- a/src/runtime/cmd/kata-runtime/kata-check_riscv64_test.go +++ b/src/runtime/cmd/kata-runtime/kata-check_riscv64_test.go @@ -22,6 +22,10 @@ func setupCheckHostIsVMContainerCapable(assert *assert.Assertions, cpuInfoFile s } func TestCCCheckCLIFunction(t *testing.T) { + if os.Getenv("GITHUB_RUNNER_CI_NON_VIRT") == "true" { + t.Skip("Skipping the test as the GitHub self hosted runners for RISC-V do not support Virtualization") + } + var cpuData []testCPUData moduleData := []testModuleData{ {filepath.Join(sysModuleDir, "kvm"), "", true},