split out test builds for each arch to help avoid travis timeout

This commit is contained in:
diginc 2017-10-02 23:46:42 -05:00
parent 51bebbe4af
commit 3c6db584d7
1 changed files with 10 additions and 16 deletions

View File

@ -11,20 +11,14 @@ run_local = testinfra.get_backend(
def test_generate_dockerfiles():
DockerfileGeneration.generate_dockerfiles()
@pytest.mark.parametrize("os, archs", [
( 'debian' , DockerfileGeneration.images['debian'] ),
( 'alpine' , DockerfileGeneration.images['alpine'] ),
])
def test_build_pihole_image(os, archs):
@pytest.mark.parametrize('arch', [ 'amd64', 'armhf', 'aarch64' ])
@pytest.mark.parametrize('os', [ 'debian', 'alpine' ])
def test_build_pihole_image(os, arch):
''' Build the entire matrix of OS+Architecture '''
for image in archs:
dockerfile = 'Dockerfile_{}_{}'.format(os, image['arch'])
image_tag = '{}:{}_{}'.format(image['name'], os, image['arch'])
run_local('docker pull {}'.format(image['base']))
build_cmd = run_local('docker build -f {} -t {} .'.format(dockerfile, image_tag))
if build_cmd.rc != 0:
print build_cmd.stdout
print build_cmd.stderr
assert build_cmd.rc == 0
dockerfile = 'Dockerfile_{}_{}'.format(os, arch)
image_tag = '{}:{}_{}'.format('pi-hole', os, arch)
build_cmd = run_local('docker build --pull -f {} -t {} .'.format(dockerfile, image_tag))
if build_cmd.rc != 0:
print build_cmd.stdout
print build_cmd.stderr
assert build_cmd.rc == 0