mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 18:55:53 +00:00
Dependind on how long it took for the jobs to start, a different seed would be used to group tests and tests could either repeat or not be selected at all. By using a seed based on the day the test run reduces the chance of using different random seeds, and still allow for the tests to be executed in a different order. The execution in different order is important to identify tests that work or fail only if executed after other tests.
87 lines
2.5 KiB
YAML
87 lines
2.5 KiB
YAML
---
|
|
parameters:
|
|
- name: group_number
|
|
type: number
|
|
default: 1
|
|
- name: number_of_groups
|
|
type: number
|
|
default: 1
|
|
- name: scenario
|
|
type: string
|
|
default: fedora-latest
|
|
- name: ansible_version
|
|
type: string
|
|
default: ""
|
|
- name: python_version
|
|
type: string
|
|
default: 3.x
|
|
- name: build_number
|
|
type: string
|
|
|
|
|
|
jobs:
|
|
- job: Test_Group${{ parameters.group_number }}
|
|
displayName: Run playbook tests ${{ parameters.scenario }} (${{ parameters.group_number }}/${{ parameters.number_of_groups }})
|
|
timeoutInMinutes: 240
|
|
variables:
|
|
- template: variables.yaml
|
|
- template: variables_${{ parameters.scenario }}.yaml
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: '${{ parameters.python_version }}'
|
|
|
|
- script: |
|
|
pip install \
|
|
"molecule-plugins[docker]" \
|
|
"requests<2.29" \
|
|
"ansible${{ parameters.ansible_version }}"
|
|
retryCountOnTaskFailure: 5
|
|
displayName: Install molecule and Ansible
|
|
|
|
- script: ansible-galaxy collection install community.docker ansible.posix
|
|
retryCountOnTaskFailure: 5
|
|
displayName: Install Ansible collections
|
|
|
|
- script: pip install -r requirements-tests.txt
|
|
retryCountOnTaskFailure: 5
|
|
displayName: Install dependencies
|
|
|
|
- script: |
|
|
utils/build-galaxy-release.sh -i
|
|
molecule create -s ${{ parameters.scenario }}
|
|
retryCountOnTaskFailure: 5
|
|
displayName: Setup test container
|
|
env:
|
|
ANSIBLE_LIBRARY: ./molecule
|
|
|
|
- script: |
|
|
python utils/check_test_configuration.py ${{ parameters.scenario }}
|
|
displayName: Check scenario test configuration
|
|
|
|
- script: |
|
|
cd ~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa
|
|
pytest \
|
|
-m "playbook" \
|
|
--verbose \
|
|
--color=yes \
|
|
--splits=${{ parameters.number_of_groups }} \
|
|
--group=${{ parameters.group_number }} \
|
|
--randomly-seed=$(date "+%Y%m%d") \
|
|
--junit-xml=TEST-results-group-${{ parameters.group_number }}.xml
|
|
displayName: Run playbook tests
|
|
env:
|
|
IPA_SERVER_HOST: ${{ parameters.scenario }}
|
|
RUN_TESTS_IN_DOCKER: true
|
|
IPA_DISABLED_MODULES: ${{ variables.ipa_disabled_modules }}
|
|
IPA_DISABLED_TESTS: ${{ variables.ipa_disabled_tests }}
|
|
IPA_ENABLED_MODULES: ${{ variables.ipa_enabled_modules }}
|
|
IPA_ENABLED_TESTS: ${{ variables.ipa_enabled_tests }}
|
|
IPA_VERBOSITY: "-vvv"
|
|
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
mergeTestResults: true
|
|
testRunTitle: PlaybookTests-Build${{ parameters.build_number }}
|
|
condition: succeededOrFailed()
|