ensure images are build prior to running tests

Signed-off-by: bcambl <blayne@blaynecampbell.com>
pull/2262/head
bcambl 6 years ago
parent e4a6dcd35c
commit 4c23964964

@ -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"

@ -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:

Loading…
Cancel
Save