Skip to content

Commit

Permalink
Minor test improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Nov 5, 2024
1 parent 66726cf commit 0f08d3e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
2 changes: 1 addition & 1 deletion tools/ee.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0f08d3e

Please sign in to comment.