diff --git a/.travis.yml b/.travis.yml index e8c6ce10..563ec131 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,8 @@ python: install: - pip install -r requirements.txt -script: py.test -vv -n auto +script: + # run tasks marked as 'build_stage' first (ensure docker images are built) + - py.test -vv -n auto -m "build_stage" + # run the remaining tasks in the test suite + - py.test -vv -n auto -m "not build_stage" diff --git a/test/test_000_build_containers.py b/test/test_000_build_containers.py index ad243754..e9e9e7db 100644 --- a/test/test_000_build_containers.py +++ b/test/test_000_build_containers.py @@ -12,6 +12,9 @@ run_local = testinfra.get_backend( ('test/centos.Dockerfile', 'pytest_pihole:centos'), ('test/fedora.Dockerfile', 'pytest_pihole:fedora'), ]) +# mark as 'build_stage' so we can ensure images are build first when tests +# are executed in parallel. (not required when tests are executed serially) +@pytest.mark.build_stage def test_build_pihole_image(image, tag): build_cmd = run_local('docker build -f {} -t {} .'.format(image, tag)) if build_cmd.rc != 0: