diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py index ef7e88990..3d063d853 100644 --- a/tests/acceptance/cli_test.py +++ b/tests/acceptance/cli_test.py @@ -2773,13 +2773,10 @@ class CLITestCase(DockerClientTestCase): def test_images_use_service_tag(self): pull_busybox(self.client) - self.base_dir = 'tests/fixtures/images-service-tag/dev' - self.dispatch(['build']) - self.base_dir = 'tests/fixtures/images-service-tag/prod' - self.dispatch(['build']) self.base_dir = 'tests/fixtures/images-service-tag' - self.dispatch(['up', '-d']) + self.dispatch(['up', '-d', '--build']) result = self.dispatch(['images']) - self.dispatch(['down']) - assert 'dev' in result.stdout + assert re.search(r'foo1.+test[ \t]+dev', result.stdout) is not None + assert re.search(r'foo2.+test[ \t]+prod', result.stdout) is not None + assert re.search(r'foo3.+_foo3[ \t]+latest', result.stdout) is not None diff --git a/tests/fixtures/images-service-tag/Dockerfile b/tests/fixtures/images-service-tag/Dockerfile new file mode 100644 index 000000000..145e0202f --- /dev/null +++ b/tests/fixtures/images-service-tag/Dockerfile @@ -0,0 +1,2 @@ +FROM busybox:latest +RUN touch /foo diff --git a/tests/fixtures/images-service-tag/dev/Dockerfile b/tests/fixtures/images-service-tag/dev/Dockerfile deleted file mode 100644 index 570e11ae3..000000000 --- a/tests/fixtures/images-service-tag/dev/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM busybox:latest -RUN touch /same-image diff --git a/tests/fixtures/images-service-tag/dev/docker-compose.yml b/tests/fixtures/images-service-tag/dev/docker-compose.yml deleted file mode 100644 index cb01f6f35..000000000 --- a/tests/fixtures/images-service-tag/dev/docker-compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: "2.2" - -services: - test: - image: busybox:dev - build: . diff --git a/tests/fixtures/images-service-tag/docker-compose.yml b/tests/fixtures/images-service-tag/docker-compose.yml index 824b9416b..aff3cf285 100644 --- a/tests/fixtures/images-service-tag/docker-compose.yml +++ b/tests/fixtures/images-service-tag/docker-compose.yml @@ -1,5 +1,10 @@ -version: "2.2" - +version: "2.4" services: - test: - image: busybox:dev + foo1: + build: . + image: test:dev + foo2: + build: . + image: test:prod + foo3: + build: . diff --git a/tests/fixtures/images-service-tag/prod/Dockerfile b/tests/fixtures/images-service-tag/prod/Dockerfile deleted file mode 100644 index 570e11ae3..000000000 --- a/tests/fixtures/images-service-tag/prod/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM busybox:latest -RUN touch /same-image diff --git a/tests/fixtures/images-service-tag/prod/docker-compose.yml b/tests/fixtures/images-service-tag/prod/docker-compose.yml deleted file mode 100644 index cb01f6f35..000000000 --- a/tests/fixtures/images-service-tag/prod/docker-compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: "2.2" - -services: - test: - image: busybox:dev - build: .