From 2235ebce2f72a5a443971bc72cc296fbfb1f170e Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Mon, 19 Jun 2023 08:57:46 +0200 Subject: [PATCH] test: register docker worker with containerd snapshotter Signed-off-by: CrazyMax --- .github/workflows/build.yml | 5 +++-- tests/workers/docker.go | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 912e9a20..ee04de4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,6 +66,7 @@ jobs: matrix: worker: - docker + - docker\+containerd # same as docker, but with containerd snapshotter - docker-container - remote pkg: @@ -101,8 +102,8 @@ jobs: export TEST_REPORT_SUFFIX=-${{ github.job }}-$(echo "${{ matrix.pkg }}-${{ matrix.skip-integration-tests }}-${{ matrix.worker }}" | tr -dc '[:alnum:]-\n\r' | tr '[:upper:]' '[:lower:]') ./hack/test env: - TEST_DOCKERD: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker-container') && '1' || '0' }}" - TESTFLAGS: "${{ (matrix.worker == 'docker') && env.TESTFLAGS_DOCKER || env.TESTFLAGS }} --run=//worker=${{ matrix.worker }}$" + TEST_DOCKERD: "${{ startsWith(matrix.worker, 'docker') && '1' || '0' }}" + TESTFLAGS: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker\\+containerd') && env.TESTFLAGS_DOCKER || env.TESTFLAGS }} --run=//worker=${{ matrix.worker }}$" TESTPKGS: "${{ matrix.pkg }}" SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}" - diff --git a/tests/workers/docker.go b/tests/workers/docker.go index 3ba32940..347ca87d 100644 --- a/tests/workers/docker.go +++ b/tests/workers/docker.go @@ -14,10 +14,15 @@ func InitDockerWorker() { integration.Register(&dockerWorker{ id: "docker", }) + integration.Register(&dockerWorker{ + id: "docker+containerd", + containerdSnapshotter: true, + }) } type dockerWorker struct { - id string + id string + containerdSnapshotter bool } func (c dockerWorker) Name() string { @@ -30,7 +35,8 @@ func (c dockerWorker) Rootless() bool { func (c dockerWorker) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) { moby := integration.Moby{ - ID: c.id, + ID: c.id, + ContainerdSnapshotter: c.containerdSnapshotter, } bk, bkclose, err := moby.New(ctx, cfg) if err != nil {