mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-11 03:05:54 +00:00
This patch removes 'molecule' as a dependency 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.
85 lines
2.5 KiB
YAML
85 lines
2.5 KiB
YAML
---
|
|
parameters:
|
|
- name: group_number
|
|
type: number
|
|
default: 1
|
|
- name: number_of_groups
|
|
type: number
|
|
default: 1
|
|
- name: distro
|
|
type: string
|
|
default: fedora-latest
|
|
- name: ansible_version
|
|
type: string
|
|
default: ""
|
|
- name: python_version
|
|
type: string
|
|
default: 3.x
|
|
- name: build_number
|
|
type: string
|
|
- name: target_python
|
|
type: string
|
|
default: "/usr/bin/python3"
|
|
|
|
jobs:
|
|
- job: Test_Group${{ parameters.group_number }}
|
|
displayName: Run playbook tests ${{ parameters.distro }} (${{ parameters.group_number }}/${{ parameters.number_of_groups }})
|
|
timeoutInMinutes: 360
|
|
variables:
|
|
- template: variables.yaml
|
|
- template: variables_${{ parameters.distro }}.yaml
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: '${{ parameters.python_version }}'
|
|
|
|
- script: |
|
|
pip install "ansible${{ parameters.ansible_version }}"
|
|
retryCountOnTaskFailure: 5
|
|
displayName: Install Ansible
|
|
|
|
- script: ansible-galaxy collection install containers.podman
|
|
retryCountOnTaskFailure: 5
|
|
displayName: Install Ansible collections
|
|
|
|
- script: pip install -r requirements-tests.txt
|
|
retryCountOnTaskFailure: 5
|
|
displayName: Install dependencies
|
|
|
|
- script: |
|
|
. utils/set_test_modules
|
|
python3 utils/check_test_configuration.py ${{ parameters.distro }}
|
|
displayName: Check test configuration
|
|
|
|
- script: |
|
|
utils/setup_test_container.sh \
|
|
-e podman \
|
|
-a \
|
|
-m 4 \
|
|
-n "ipaserver.test.local" \
|
|
-p ${{ parameters.target_python }} \
|
|
-i ${{ parameters.distro }}-server \
|
|
${{ parameters.distro }}-test
|
|
displayName: Setup target container
|
|
|
|
- script: |
|
|
. utils/set_test_modules
|
|
pytest -m "playbook" --verbose --color=yes --suppress-no-test-exit-code --junit-xml=TEST-results-pr-check.xml
|
|
displayName: Run playbook tests
|
|
env:
|
|
ANSIBLE_ROLES_PATH: "${PWD}/roles"
|
|
ANSIBLE_LIBRARY: "${PWD}/plugins"
|
|
ANSIBLE_MODULE_UTILS: "${PWD}/plugins/module_utils"
|
|
IPA_SERVER_HOST: ${{ parameters.distro }}-test
|
|
RUN_TESTS_IN_DOCKER: podman
|
|
IPA_DISABLED_MODULES: ${{ variables.ipa_disabled_modules }}
|
|
IPA_DISABLED_TESTS: ${{ variables.ipa_disabled_tests }}
|
|
IPA_VERBOSITY: "-vvv"
|
|
IPA_PYTHON_PATH: ${{ parameters.target_python }}
|
|
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
mergeTestResults: true
|
|
testRunTitle: PlaybookTests-Build${{ parameters.build_number }}
|
|
condition: succeededOrFailed()
|