diff --git a/pyproject.toml b/pyproject.toml index 20bb769..ac43059 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -328,6 +328,7 @@ addopts = "-ra --showlocals --durations=10 -p no:pytest-ansible" cache_dir = "./.cache/.pytest" log_cli = true log_cli_level = "WARNING" +showlocals = true testpaths = "tests" tmp_path_retention_policy = "failed" verbosity_assertions = 2 diff --git a/tests/conftest.py b/tests/conftest.py index 2a365be..075396d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -345,11 +345,14 @@ def get_nav_default_ee_in_container() -> str: str: The default ee for navigator in the container. """ cmd = ( - 'python -c "from ansible_navigator.utils.packaged_data import ImageEntry;' + 'python3 -c "from ansible_navigator.utils.packaged_data import ImageEntry;' 'print(ImageEntry.DEFAULT_EE.get(app_name=\\"ansible_navigator\\"))"' ) proc = _exec_container(cmd) + if proc.returncode != 0: + err = f"Failed to get default ee for navigator in container:\n{proc.stderr}\n{proc.stdout}" + pytest.fail(err) return proc.stdout.strip() diff --git a/tools/ee.sh b/tools/ee.sh index f191b51..8f3e85f 100755 --- a/tools/ee.sh +++ b/tools/ee.sh @@ -65,7 +65,7 @@ cp tools/setup-image.sh final/ $BUILD_CMD -f final/Containerfile final/ --tag "${CONTAINER_NAME}" # Check container size and layers -mk containers check $CONTAINER_NAME --engine="${ADT_CONTAINER_ENGINE}" --max-size=1430 --max-layers=22 +mk containers check $CONTAINER_NAME --engine="${ADT_CONTAINER_ENGINE}" --max-size=1500 --max-layers=22 pytest -v --only-container --container-engine=docker --image-name "${CONTAINER_NAME}" # -k test_navigator_simple diff --git a/tox.ini b/tox.ini index 056220f..5606fa1 100644 --- a/tox.ini +++ b/tox.ini @@ -133,18 +133,10 @@ allowlist_externals = description = Build devspaces container image for current architecture skip_install = true deps = + -r .config/requirements-test.in mk commands_pre = commands = - ./tools/devspaces.sh + ./tools/devspaces.sh {posargs} allowlist_externals = ./tools/devspaces.sh - -[testenv:test-ee] -description = - Run tests in the ee container image -commands_pre = -commands = - pytest --only-container {posargs} -allowlist_externals = - pytest