Make test-e2e run against experimental and non-experimental daemon

- `make test-e2e` runs the e2e tests twice : once against on
  non-experimental daemon (as before), once against an experimental
  daemon.
- adds `test-e2e-experimental` and `test-e2e-non-experimental` target
  to run tests for the specified cases

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2018-06-25 11:46:35 +02:00
parent 0e83042e54
commit a522a78231
No known key found for this signature in database
GPG Key ID: 083CC6FD6EB699A3
5 changed files with 19 additions and 3 deletions

View File

@ -119,5 +119,12 @@ shellcheck: build_shell_validate_image
docker run -ti --rm $(ENVVARS) $(MOUNTS) $(VALIDATE_IMAGE_NAME) make shellcheck docker run -ti --rm $(ENVVARS) $(MOUNTS) $(VALIDATE_IMAGE_NAME) make shellcheck
.PHONY: test-e2e .PHONY: test-e2e
test-e2e: build_e2e_image test-e2e: test-e2e-non-experimental test-e2e-experimental
.PHONY: test-e2e-experimental
test-e2e-experimental: build_e2e_image
docker run -e DOCKERD_EXPERIMENTAL=1 --rm -v /var/run/docker.sock:/var/run/docker.sock $(E2E_IMAGE_NAME)
.PHONY: test-e2e-non-experimental
test-e2e-non-experimental: build_e2e_image
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock $(E2E_IMAGE_NAME) docker run --rm -v /var/run/docker.sock:/var/run/docker.sock $(E2E_IMAGE_NAME)

View File

@ -0,0 +1,6 @@
version: '2.1'
services:
engine:
command: ["--insecure-registry=registry:5000", "--experimental"]

View File

@ -118,6 +118,7 @@ func TestBuildIidFileSquash(t *testing.T) {
FROM %s FROM %s
ENV FOO FOO ENV FOO FOO
ENV BAR BAR ENV BAR BAR
RUN touch /fiip
RUN touch /foop`, fixtures.AlpineImage)), RUN touch /foop`, fixtures.AlpineImage)),
) )
defer buildDir.Remove() defer buildDir.Remove()

View File

@ -15,7 +15,10 @@ function fetch_images {
function setup { function setup {
local project=$1 local project=$1
COMPOSE_PROJECT_NAME=$1 COMPOSE_FILE=$2 docker-compose up --build -d >&2 local file=$2
test "${DOCKERD_EXPERIMENTAL:-}" -eq "1" && file="${file}:./e2e/compose-env.experimental.yaml"
COMPOSE_PROJECT_NAME=$project COMPOSE_FILE=$file docker-compose up --build -d >&2
local network="${project}_default" local network="${project}_default"
# TODO: only run if inside a container # TODO: only run if inside a container

View File

@ -5,7 +5,6 @@ set -eu -o pipefail
engine_host=$(./scripts/test/e2e/run setup) engine_host=$(./scripts/test/e2e/run setup)
testexit=0 testexit=0
test_cmd="test" test_cmd="test"
if [[ -n "${TEST_DEBUG-}" ]]; then if [[ -n "${TEST_DEBUG-}" ]]; then
test_cmd="shell" test_cmd="shell"