Skip to content

Commit

Permalink
[6.15.z] use packaged pytest, not some venv (#16717)
Browse files Browse the repository at this point in the history
use packaged pytest, not some venv (#16694)

(cherry picked from commit ddb3ec1)

Co-authored-by: Evgeni Golov <[email protected]>
  • Loading branch information
Satellite-QE and evgeni authored Oct 21, 2024
1 parent a1db30c commit 9896f12
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/foreman/sys/test_fam.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ def setup_fam(module_target_sat, module_sca_manifest, install_import_ansible_rol
# Edit Makefile to not try to rebuild the collection when tests run
module_target_sat.execute(f"sed -i '/^live/ s/$(MANIFEST)//' {FAM_ROOT_DIR}/Makefile")

# Edit Makefile to use passed-in pytest
# Can be removed once https://github.com/theforeman/foreman-ansible-modules/pull/1788
# is present in all relevant branches
module_target_sat.execute(
f"sed -i '/test_crud/ s/pytest/$(PYTEST_COMMAND)/' {FAM_ROOT_DIR}/Makefile"
)

# Upload manifest to test playbooks directory
module_target_sat.put(str(module_sca_manifest.path), str(module_sca_manifest.name))
module_target_sat.execute(
Expand Down Expand Up @@ -141,7 +148,7 @@ def test_positive_run_modules_and_roles(module_target_sat, setup_fam, ansible_mo

# Execute test_playbook
result = module_target_sat.execute(
f'export NO_COLOR=True && . ~/localenv/bin/activate && cd {FAM_ROOT_DIR} && make livetest_{ansible_module}'
f'export NO_COLOR=True && cd {FAM_ROOT_DIR} && make livetest_{ansible_module} PYTHON_COMMAND="python3" PYTEST_COMMAND="pytest-3.11"'
)
assert 'PASSED' in result.stdout
assert result.status == 0

0 comments on commit 9896f12

Please sign in to comment.