Skip to content

Commit

Permalink
upstream ci: Use util scripts instead of molecule
Browse files Browse the repository at this point in the history
This patch start the removal of the dependency on molecule for tests,
by using the scripts under `utils` to setup the environment.

By not using molecule, we have more flexibility on using either docker
or podman as the container engine, and makes it easy to reproduce the
environment on different distros, allowing for a more consistent error
reproduction off Azure.
  • Loading branch information
rjeffman committed Jun 26, 2024
1 parent 081b75b commit b4c6965
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/azure/pr-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trigger:
- master

pool:
vmImage: 'ubuntu-20.04'
vmImage: 'ubuntu-22.04'

stages:

Expand Down
30 changes: 14 additions & 16 deletions tests/azure/templates/playbook_fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ jobs:
versionSpec: '${{ parameters.python_version }}'

- script: |
pip install \
"molecule-plugins[docker]" \
"requests<2.29" \
"ansible${{ parameters.ansible_version }}"
pip install "ansible${{ parameters.ansible_version }}"
retryCountOnTaskFailure: 5
displayName: Install molecule and Ansible
displayName: Install Ansible
- script: ansible-galaxy collection install community.docker ansible.posix
- script: |
rm -rf ~/.ansible
mkdir -p ~/.ansible/roles ~/.ansible/library ~/.ansible/module_utils
cp -a roles/* ~/.ansible/roles
cp -a plugins/modules/* ~/.ansible/library
cp -a plugins/module_utils/* ~/.ansible/module_utils
retryCountOnTaskFailure: 5
displayName: Setup controller environment
- script: ansible-galaxy collection install containers.podman ansible.posix
retryCountOnTaskFailure: 5
displayName: Install Ansible collections

Expand All @@ -47,16 +53,8 @@ jobs:
displayName: Install dependencies

- script: |
rm -rf ~/ansible
mkdir -p ~/.ansible/roles ~/.ansible/library ~/.ansible/module_utils
cp -a roles/* ~/.ansible/roles
cp -a plugins/modules/* ~/.ansible/library
cp -a plugins/module_utils/* ~/.ansible/module_utils
molecule create -s ${{ parameters.scenario }}
retryCountOnTaskFailure: 5
utils/setup_test_container.sh -e podman -i ${{ parameters.scenario }} ${{ parameters.scenario }}
displayName: Setup test container
env:
ANSIBLE_LIBRARY: ./molecule
- script: |
. utils/set_test_modules
Expand All @@ -80,7 +78,7 @@ jobs:
displayName: Run playbook tests
env:
IPA_SERVER_HOST: ${{ parameters.scenario }}
RUN_TESTS_IN_DOCKER: true
RUN_TESTS_IN_DOCKER: podman
IPA_DISABLED_MODULES: ${{ variables.ipa_disabled_modules }}
IPA_DISABLED_TESTS: ${{ variables.ipa_disabled_tests }}
IPA_VERBOSITY: "-vvv"
Expand Down

0 comments on commit b4c6965

Please sign in to comment.