From ac52547f2b17f1e195e4489884baf12c7bfa4772 Mon Sep 17 00:00:00 2001 From: 0x5487 Date: Sun, 1 Mar 2026 16:49:40 +0800 Subject: [PATCH] fix: Configure CI to use Docker for go tests and add Docker availability checks to sandbox manager tests. --- .github/workflows/pr.yml | 2 ++ pkg/agent/sandbox/manager_test.go | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index be1c10c52..e582c6288 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -41,3 +41,5 @@ jobs: - name: Run go test run: go test ./... + env: + DOCKER_HOST: unix:///var/run/docker.sock diff --git a/pkg/agent/sandbox/manager_test.go b/pkg/agent/sandbox/manager_test.go index 7dfd6e398..ff6c5be70 100644 --- a/pkg/agent/sandbox/manager_test.go +++ b/pkg/agent/sandbox/manager_test.go @@ -311,6 +311,9 @@ func TestScopedSandboxManager_Delegates(t *testing.T) { } func TestScopedSandboxManager_ContainerDelegates(t *testing.T) { + _, cleanup := skipIfNoDocker(t) + defer cleanup() + home := t.TempDir() t.Setenv("HOME", home) ws := filepath.Join(home, "container_ws") @@ -379,6 +382,9 @@ func TestScopedSandboxManager_ContainerDelegates(t *testing.T) { } func TestScopedSandboxManager_ContainerCreationError(t *testing.T) { + _, cleanup := skipIfNoDocker(t) + defer cleanup() + home := t.TempDir() t.Setenv("HOME", home)