Skip to content

Commit 26c0f4d

Browse files
authored
Minor test improvements (#466)
1 parent 66726cf commit 26c0f4d

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ addopts = "-ra --showlocals --durations=10 -p no:pytest-ansible"
328328
cache_dir = "./.cache/.pytest"
329329
log_cli = true
330330
log_cli_level = "WARNING"
331+
showlocals = true
331332
testpaths = "tests"
332333
tmp_path_retention_policy = "failed"
333334
verbosity_assertions = 2

tests/conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,14 @@ def get_nav_default_ee_in_container() -> str:
345345
str: The default ee for navigator in the container.
346346
"""
347347
cmd = (
348-
'python -c "from ansible_navigator.utils.packaged_data import ImageEntry;'
348+
'python3 -c "from ansible_navigator.utils.packaged_data import ImageEntry;'
349349
'print(ImageEntry.DEFAULT_EE.get(app_name=\\"ansible_navigator\\"))"'
350350
)
351351

352352
proc = _exec_container(cmd)
353+
if proc.returncode != 0:
354+
err = f"Failed to get default ee for navigator in container:\n{proc.stderr}\n{proc.stdout}"
355+
pytest.fail(err)
353356
return proc.stdout.strip()
354357

355358

tools/ee.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ cp tools/setup-image.sh final/
6565
$BUILD_CMD -f final/Containerfile final/ --tag "${CONTAINER_NAME}"
6666

6767
# Check container size and layers
68-
mk containers check $CONTAINER_NAME --engine="${ADT_CONTAINER_ENGINE}" --max-size=1430 --max-layers=22
68+
mk containers check $CONTAINER_NAME --engine="${ADT_CONTAINER_ENGINE}" --max-size=1500 --max-layers=22
6969

7070
pytest -v --only-container --container-engine=docker --image-name "${CONTAINER_NAME}"
7171
# -k test_navigator_simple

tox.ini

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,10 @@ allowlist_externals =
133133
description = Build devspaces container image for current architecture
134134
skip_install = true
135135
deps =
136+
-r .config/requirements-test.in
136137
mk
137138
commands_pre =
138139
commands =
139-
./tools/devspaces.sh
140+
./tools/devspaces.sh {posargs}
140141
allowlist_externals =
141142
./tools/devspaces.sh
142-
143-
[testenv:test-ee]
144-
description =
145-
Run tests in the ee container image
146-
commands_pre =
147-
commands =
148-
pytest --only-container {posargs}
149-
allowlist_externals =
150-
pytest

0 commit comments

Comments
 (0)