test: register docker worker with containerd snapshotter

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
pull/1897/head
CrazyMax 2 years ago committed by CrazyMax
parent 7147463418
commit 2235ebce2f
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

@ -66,6 +66,7 @@ jobs:
matrix: matrix:
worker: worker:
- docker - docker
- docker\+containerd # same as docker, but with containerd snapshotter
- docker-container - docker-container
- remote - remote
pkg: 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:]') 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 ./hack/test
env: env:
TEST_DOCKERD: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker-container') && '1' || '0' }}" TEST_DOCKERD: "${{ startsWith(matrix.worker, 'docker') && '1' || '0' }}"
TESTFLAGS: "${{ (matrix.worker == 'docker') && env.TESTFLAGS_DOCKER || env.TESTFLAGS }} --run=//worker=${{ matrix.worker }}$" TESTFLAGS: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker\\+containerd') && env.TESTFLAGS_DOCKER || env.TESTFLAGS }} --run=//worker=${{ matrix.worker }}$"
TESTPKGS: "${{ matrix.pkg }}" TESTPKGS: "${{ matrix.pkg }}"
SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}" SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}"
- -

@ -14,10 +14,15 @@ func InitDockerWorker() {
integration.Register(&dockerWorker{ integration.Register(&dockerWorker{
id: "docker", id: "docker",
}) })
integration.Register(&dockerWorker{
id: "docker+containerd",
containerdSnapshotter: true,
})
} }
type dockerWorker struct { type dockerWorker struct {
id string id string
containerdSnapshotter bool
} }
func (c dockerWorker) Name() string { 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) { func (c dockerWorker) New(ctx context.Context, cfg *integration.BackendConfig) (b integration.Backend, cl func() error, err error) {
moby := integration.Moby{ moby := integration.Moby{
ID: c.id, ID: c.id,
ContainerdSnapshotter: c.containerdSnapshotter,
} }
bk, bkclose, err := moby.New(ctx, cfg) bk, bkclose, err := moby.New(ctx, cfg)
if err != nil { if err != nil {

Loading…
Cancel
Save