linux-system-roles / test-harness

Test harness for linux system roles
GNU General Public License v3.0
10 stars 18 forks source link

CI fails if test_collections is set to true #115

Open nhosoi opened 3 years ago

nhosoi commented 3 years ago

The option test_collections is now set to true in staging, which makes CI test fail due to the lack of ruamel.yaml in RHEL-8. I'd think it depends on this bz... Should we add a code to run-test to check whether the module ruamel.yaml is available - [0]? And proceed only if it is available to prevent this error?

Use cached CentOS-8-GenericCloud-8.2.2004-20200611.2.x86_64.qcow2
+ git init --quiet /tmp/tmpu3q33ze4
+ GIT_TERMINAL_PROMPT=0 git -C /tmp/tmpu3q33ze4 fetch --quiet --depth=1 https://github.com/linux-system-roles/ci-testing pull/8/head
+ git -C /tmp/tmpu3q33ze4 checkout --quiet FETCH_HEAD
Traceback (most recent call last):
  File "/test/run-tests", line 963, in handle_task
    result = task.run(
  File "/test/run-tests", line 429, in run
    from lsr_role2collection import role2collection
  File "/test/lsr_role2collection.py", line 36, in <module>
    from ruamel.yaml import YAML
ModuleNotFoundError: No module named 'ruamel'

[0] It looks the method to check the availability is different among python2, python3 < 3.4, and python3 >= 3.4...

richm commented 3 years ago

We should add ruamel to the containers - for the ansible 2.9 container running on fedora 32, we should just have to install the python3-ruamel-yaml package https://github.com/linux-system-roles/test-harness/blob/master/Dockerfile#L5 For the ansible 2.8/centos7 container - https://github.com/linux-system-roles/test-harness/blob/master/Dockerfile.centos7#L3 - would prefer to install it as an rpm - maybe from epel7 - otherwise, we can install from pip as a last resort

pcahyna commented 3 years ago

Can you skip building collections on EL 7 for now?

nhosoi commented 3 years ago

We should add ruamel to the containers - for the ansible 2.9 container running on fedora 32, we should just have to install the python3-ruamel-yaml package https://github.com/linux-system-roles/test-harness/blob/master/Dockerfile#L5

Thanks, @richm. I added the python3-ruamel-yaml package to Dockerfile, but it still fails for other reason. :p Debugging it now.

Can you skip building collections on EL 7 for now?

Sure, @pcahyna. I'm going to add the condition to skip the collection test. BTW, currently, a global option test_collections controls the collections test's on/off. Should I change it to per image instead of one for all? (Then, we can just disable it for el7.)

pcahyna commented 3 years ago

a global option test_collections controls the collections test's on/off. Should I change it to per image instead of one for all? (Then, we can just disable it for el7.)

No, because the problem is not with the el7 image, it is with the el7 testing container (the one running the harness and Ansible). Or am I missing something?

nhosoi commented 3 years ago

a global option test_collections controls the collections test's on/off. Should I change it to per image instead of one for all? (Then, we can just disable it for el7.)

No, because the problem is not with the el7 image, it is with the el7 testing container (the one running the harness and Ansible). Or am I missing something?

Hmm, you meant we do not want to touch Dockerfile.centos7? Sorry, I seems I misunderstood your suggestions... Could you please give me some more details?