Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Add a playbook and job to run sanity tests #122

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dmsimard
Copy link
Contributor

This is meant to install every collection in a release's
galaxy-requirements.yaml and then iterate over them to run sanity tests
on each.

Note that errors are not fatal yet (ignore_errors: true).

@dmsimard dmsimard force-pushed the sanity-tests branch 3 times, most recently from d2dae58 to c96978a Compare May 12, 2022 13:49
Copy link
Contributor

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

.github/workflows/sanity-tests.yml Outdated Show resolved Hide resolved
.github/workflows/sanity-tests.yml Outdated Show resolved Hide resolved
.github/workflows/sanity-tests.yml Outdated Show resolved Hide resolved
.github/workflows/sanity-tests.yml Outdated Show resolved Hide resolved
@dmsimard
Copy link
Contributor Author

How about:

I like this but it won't pick up 2.13 yet because it's a pre-release. I've gone ahead and committed the suggestion anyway (2.13 releases next week) but we can also figure something out (add --pre to the pip install?)

This is meant to install every collection in a release's
galaxy-requirements.yaml and then iterate over them to run sanity tests
on each.

Note that errors are not fatal yet (ignore_errors: true).

Co-authored-by: David Moreau Simard <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
ansible_core_next: 2.13
- name: latest Ansible 6 release
ansible_major: 6
ansible_core: 2.13
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: this won't work until 2.13 releases next week

- name: Install ansible-core ${{ matrix.ansible_core }}
run: |
python3 -m pip install --upgrade pip
python3 -m pip install ansible-core>=${{ matrix.ansible_core }},${{ matrix.ansible_core_next }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way it should also install pre-releases of ansible-core, without installing pre-releases of ansible-core's dependencies:

Suggested change
python3 -m pip install ansible-core>=${{ matrix.ansible_core }},${{ matrix.ansible_core_next }}
python3 -m pip install ansible-core>=${{ matrix.ansible_core }}a1,${{ matrix.ansible_core_next }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious and want to test it out of curiosity, let me get back to you on that.

ANSIBLE_COLLECTIONS_PATH: "{{ collections_path }}"
command: ansible-galaxy collection install -r {{ galaxy_requirements }}
args:
creates: "{{ collections_path }}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add a retry here because it can (and will) fail like this:

 ________________________________________   
< TASK [Install collections from galaxy] > 
 ----------------------------------------
        \   ^__^            
         \  (oo)\_______    
            (__)\       )\/\
                ||----w |                                                      
                ||     ||
                                                                               
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["ansible-galaxy", "collection", "install", "-r", "/root/src/ansible-build-data/6/galaxy-requirements.yaml"], "delta": "0:00:28.981410", "end": "2022-05-17 19:47:26.388533", "msg": "non-zero return code", "rc": 1, "start": "2022-05-17 19:46:57.407123", "stderr": 
"ERROR! Error when getting the collection info for cloud.common from default (https://galaxy.ansible.com/api/) (HTTP Code: 502, Message: Bad Gateway Code: Unknown)", "stderr_lines": ["ERROR! Error when getting the collection info for cloud.common from default (https://galaxy.ansible.com/api/) (HTTP Code: 502, Message:
 Bad Gateway Code: Unknown)"], "stdout": "Starting galaxy collection install process\nProcess install dependency map", "stdout_lines": ["Starting galaxy collection install process", "Process install dependency map"]}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants