Closed furhouse closed 5 years ago
Thanks @furhouse I think this may be your problem:
pip show nailgun | grep Version Version: 0.31.0
I'd suggest trying with Nailgun on master or the 6.4.z
branch (as I've backported a few commits on that branch)
To make sure I'm using python3, I've set up a venv, then explicitly installed nailgun
from both master
and 6.4.z
. make test_activation_key
passes with both branches, record_activation_key
still seems to fail:
❯ virtualenv -p /usr/bin/python3.6 --system-site-packages venv2
❯ source venv2/bin/activate
venv2 ❯ pip install 'git+https://github.com/SatelliteQE/nailgun.git@6.4.z#egg=nailgun' / also tested master
...
Successfully installed nailgun-0.30.2
venv2 ❯ cd /tmp/foreman-ansible-modules
venv2 ❯ make test-setup
venv2 ❯ ansible --version
ansible 2.7.7
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/furhouse/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /tmp/venv2/lib/python3.6/site-packages/ansible
executable location = /tmp/venv2/bin/ansible
python version = 3.6.8 (default, Feb 20 2019, 08:51:39) [GCC 8.2.1 20181127]
venv2 ❯ make test_activation_key
pytest 'test/test_crud.py::test_crud[activation_key]'
============================================================================================================================================================================ test session starts ============================================================================================================================================================================
platform linux -- Python 3.6.8, pytest-4.3.0, py-1.7.0, pluggy-0.8.1
rootdir: /tmp/foreman-ansible-modules, inifile:
collected 1 item
test/test_crud.py . [100%]
========================================================================================================================================================================= 1 passed in 7.23 seconds ==========================================================================================================================================================================
venv2 ❯ make record_activation_key
rm -f test/test_playbooks/fixtures/activation_key-*.yml
pytest 'test/test_crud.py::test_crud[activation_key]' --record
============================================================================================================================================================================ test session starts ============================================================================================================================================================================
platform linux -- Python 3.6.8, pytest-4.3.0, py-1.7.0, pluggy-0.8.1
rootdir: /tmp/foreman-ansible-modules, inifile:
collected 1 item
test/test_crud.py F [100%]
================================================================================================================================================================================= FAILURES ==================================================================================================================================================================================
_________________________________________________________________________________________________________________________________________________________________________ test_crud[activation_key] _________________________________________________________________________________________________________________________________________________________________________
module = 'activation_key', record = True
@pytest.mark.parametrize('module', MODULES)
def test_crud(module, record):
> assert run_playbook_vcr(module, record=record) == 0
E AssertionError: assert 2 == 0
E + where 2 = run_playbook_vcr('activation_key', record=True)
test/test_crud.py:80: AssertionError
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PLAY [fixtures] ****************************************************************
TASK [Load server config] ******************************************************
ok: [fixtures]
TASK [Ensure organization 'Test Organization' is present] **********************
ok: [fixtures]
TASK [fail] ********************************************************************
skipping: [fixtures]
TASK [Ensure product 'Test Product' is present] ********************************
ok: [fixtures]
TASK [fail] ********************************************************************
skipping: [fixtures]
TASK [Create katello repository] ***********************************************
ok: [fixtures]
PLAY [tests] *******************************************************************
TASK [Load server config] ******************************************************
ok: [tests]
TASK [Create/update katello activation key] ************************************
changed: [tests]
TASK [fail] ********************************************************************
skipping: [tests]
TASK [Create/update minimal katello activation key] ****************************
ok: [tests]
TASK [fail] ********************************************************************
skipping: [tests]
TASK [Create/update katello activation key] ************************************
changed: [tests]
TASK [fail] ********************************************************************
fatal: [tests]: FAILED! => {"changed": false, "msg": "Creating/updating activation key failed! (expected_change: False)"}
PLAY RECAP *********************************************************************
fixtures : ok=4 changed=0 unreachable=0 failed=0
tests : ok=4 changed=2 unreachable=0 failed=1
========================================================================================================================================================================= 1 failed in 7.99 seconds ==========================================================================================================================================================================
make: *** [Makefile:36: record_activation_key] Error 1
SUMMARY
The
test/test_playbooks/activation_key.yml
playbook seems to fail.ISSUE TYPE
ANSIBLE VERSION
KATELLO/FOREMAN VERSION
NAILGUN VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
I would expect the
test_activation_key
target to pass.ACTUAL RESULTS
Both the
test_activation_key
andrecord_activation_key
targets fail.NOTES
Just quickly disabling some tasks/vars with
expected_change: false
seems to 'help':