diff --git a/conftest.py b/conftest.py index 222655643..757325d21 100644 --- a/conftest.py +++ b/conftest.py @@ -10,3 +10,7 @@ def environ(): # [ERROR]: failed to download the file: HTTP Error 401: Unauthorized # https://github.com/ansible/ansible/issues/61666 os.environ['NETRC'] = '' + + # adds extra environment variables that may be needed during testing + if not os.environ.get('TEST_BASE_IMAGE', ""): + os.environ['TEST_BASE_IMAGE'] = 'docker.io/pycontribs/centos:7' diff --git a/molecule/test/functional/docker/test_scenarios.py b/molecule/test/functional/docker/test_scenarios.py index 294478781..fd12a8abd 100644 --- a/molecule/test/functional/docker/test_scenarios.py +++ b/molecule/test/functional/docker/test_scenarios.py @@ -221,7 +221,7 @@ def test_command_test_builds_local_molecule_image( scenario_to_test, with_scenario, scenario_name, driver_name ): try: - image = os.environ.get('TEST_BASE_IMAGE', "docker.io/pycontribs/centos:7") + image = os.environ['TEST_BASE_IMAGE'] cmd = sh.docker.bake('rmi', 'molecule_local/{}'.format(image), '--force') pytest.helpers.run_command(cmd) except sh.ErrorReturnCode: diff --git a/tox.ini b/tox.ini index 72bd7d5e5..4cd2ce542 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,6 @@ passenv = * setenv = ANSIBLE_CALLABLE_WHITELIST={env:ANSIBLE_CALLABLE_WHITELIST:timer,profile_roles} PYTHONDONTWRITEBYTECODE=1 - TEST_BASE_IMAGE=docker.io/pycontribs/centos:7 # -n auto used only on unit as is not supported by functional yet unit: PYTEST_ADDOPTS=molecule/test/unit/ --cov={toxinidir}/molecule/ --no-cov-on-fail {env:PYTEST_ADDOPTS:-n auto} functional: PYTEST_ADDOPTS=molecule/test/functional/ {env:PYTEST_ADDOPTS:}