Skip to content

Commit

Permalink
upstream CI: Use start.sh script and environment template
Browse files Browse the repository at this point in the history
The upstream CI tests can be simplified by using the script
infra/image/start.sh to start the testing container and using a steps
template playbook to prepare the environment.

Although not required, the environment and test template separation
aid on the future modification of the pipelines.
  • Loading branch information
rjeffman committed Oct 15, 2024
1 parent 6e22c0d commit ca59e72
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 120 deletions.
8 changes: 7 additions & 1 deletion infra/azure/azure-pipelines.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 All @@ -17,6 +17,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core"
filter_tests: false

# Fedora

Expand All @@ -28,6 +29,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core <2.14"
filter_tests: false

# Fedora

Expand All @@ -39,6 +41,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core >=2.14,<2.15"
filter_tests: false

# Galaxy on Fedora

Expand All @@ -50,6 +53,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core >=2.14,<2.15"
filter_tests: false

# CentOS 9 Stream

Expand All @@ -61,6 +65,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c9s
ansible_version: "-core >=2.14,<2.15"
filter_tests: false

# CentOS 8 Stream

Expand All @@ -72,3 +77,4 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c8s
ansible_version: "-core >=2.14,<2.15"
filter_tests: false
20 changes: 20 additions & 0 deletions infra/azure/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core >=2.13,<2.14"
filter_tests: false

- stage: FedoraLatest_Ansible_Core_2_14
dependsOn: []
Expand All @@ -33,6 +34,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core >=2.14,<2.15"
filter_tests: false

- stage: FedoraLatest_Ansible_Core_2_15
dependsOn: []
Expand All @@ -42,6 +44,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core >=2.15,<2.16"
filter_tests: false

- stage: FedoraLatest_Ansible_latest
dependsOn: []
Expand All @@ -51,6 +54,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: ""
filter_tests: false

# Galaxy on Fedora

Expand All @@ -62,6 +66,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core >=2.13,<2.14"
filter_tests: false

- stage: Galaxy_FedoraLatest_Ansible_Core_2_14
dependsOn: []
Expand All @@ -71,6 +76,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core >=2.14,<2.15"
filter_tests: false

- stage: Galaxy_FedoraLatest_Ansible_Core_2_15
dependsOn: []
Expand All @@ -80,6 +86,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: "-core >=2.15,<2.16"
filter_tests: false

- stage: Galaxy_FedoraLatest_Ansible_latest
dependsOn: []
Expand All @@ -89,6 +96,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-latest
ansible_version: ""
filter_tests: false

# Fedora Rawhide

Expand All @@ -100,6 +108,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-rawhide
ansible_version: "-core >=2.13,<2.14"
filter_tests: false

- stage: FedoraRawhide_Ansible_Core_2_14
dependsOn: []
Expand All @@ -109,6 +118,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-rawhide
ansible_version: "-core >=2.14,<2.15"
filter_tests: false

- stage: FedoraRawhide_Ansible_Core_2_15
dependsOn: []
Expand All @@ -118,6 +128,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-rawhide
ansible_version: "-core >=2.15,<2.16"
filter_tests: false

- stage: FedoraRawhide_Ansible_latest
dependsOn: []
Expand All @@ -127,6 +138,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: fedora-rawhide
ansible_version: ""
filter_tests: false

# CentoOS 9 Stream

Expand All @@ -138,6 +150,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c9s
ansible_version: "-core >=2.13,<2.14"
filter_tests: false

- stage: c9s_Ansible_Core_2_14
dependsOn: []
Expand All @@ -147,6 +160,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c9s
ansible_version: "-core >=2.14,<2.15"
filter_tests: false

- stage: c9s_Ansible_Core_2_15
dependsOn: []
Expand All @@ -156,6 +170,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c9s
ansible_version: "-core >=2.15,<2.16"
filter_tests: false

- stage: c9s_Ansible_latest
dependsOn: []
Expand All @@ -165,6 +180,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c9s
ansible_version: ""
filter_tests: false

# CentOS 8 Stream

Expand All @@ -176,6 +192,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c8s
ansible_version: "-core >=2.13,<2.14"
filter_tests: false

- stage: c8s_Ansible_Core_2_14
dependsOn: []
Expand All @@ -185,6 +202,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c8s
ansible_version: "-core >=2.14,<2.15"
filter_tests: false

- stage: c8s_Ansible_Core_2_15
dependsOn: []
Expand All @@ -194,6 +212,7 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c8s
ansible_version: "-core >=2.15,<2.16"
filter_tests: false

- stage: c8s_Ansible_latest
dependsOn: []
Expand All @@ -203,3 +222,4 @@ stages:
build_number: $(Build.BuildNumber)
scenario: c8s
ansible_version: ""
filter_tests: false
17 changes: 11 additions & 6 deletions infra/azure/pr-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,58 @@ stages:
- stage: Fedora_Latest
dependsOn: []
jobs:
- template: templates/fast_tests.yml
- template: templates/playbook_tests.yml
parameters:
build_number: $(Build.BuildNumber)
distro: fedora-latest
ansible_version: "-core >=2.15,<2.16"
filter_tests: true

# Galaxy on Fedora

- stage: Galaxy_Fedora_Latest
dependsOn: []
jobs:
- template: templates/fast_tests.yml
- template: templates/playbook_tests.yml
parameters:
build_number: $(Build.BuildNumber)
distro: fedora-latest
ansible_version: "-core >=2.15,<2.16"
filter_tests: true

# CentOS 9 Stream

- stage: CentOS_9_Stream
dependsOn: []
jobs:
- template: templates/fast_tests.yml
- template: templates/playbook_tests.yml
parameters:
build_number: $(Build.BuildNumber)
distro: c9s
ansible_version: "-core >=2.15,<2.16"
filter_tests: true

# CentOS 8 Stream

- stage: CentOS_8_Stream
dependsOn: []
jobs:
- template: templates/fast_tests.yml
- template: templates/playbook_tests.yml
parameters:
build_number: $(Build.BuildNumber)
distro: c8s
ansible_version: "-core >=2.15,<2.16"
target_python: "/usr/libexec/platform-python"
# target_python: "/usr/libexec/platform-python"
filter_tests: true

# Rawhide

- stage: Fedora_Rawhide
dependsOn: []
jobs:
- template: templates/fast_tests.yml
- template: templates/playbook_tests.yml
parameters:
build_number: $(Build.BuildNumber)
distro: fedora-rawhide
ansible_version: "-core >=2.15,<2.16"
filter_tests: true
6 changes: 6 additions & 0 deletions infra/azure/templates/group_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ parameters:
- name: ansible_version
type: string
default: ""
- name: filter_tests
type: boolean
defaut: true

jobs:
- template: playbook_tests.yml
Expand All @@ -18,6 +21,7 @@ jobs:
scenario: ${{ parameters.scenario }}
ansible_version: ${{ parameters.ansible_version }}
python_version: '< 3.12'
filter_tests: ${{ parameters.filter_tests }}

- template: playbook_tests.yml
parameters:
Expand All @@ -27,6 +31,7 @@ jobs:
scenario: ${{ parameters.scenario }}
ansible_version: ${{ parameters.ansible_version }}
python_version: '< 3.12'
filter_tests: ${{ parameters.filter_tests }}

- template: playbook_tests.yml
parameters:
Expand All @@ -36,6 +41,7 @@ jobs:
scenario: ${{ parameters.scenario }}
ansible_version: ${{ parameters.ansible_version }}
python_version: '< 3.12'
filter_tests: ${{ parameters.filter_tests }}

# Temporarily disabled due to ansible docker plugin issue.
#- template: pytest_tests.yml
Expand Down
28 changes: 1 addition & 27 deletions infra/azure/templates/playbook_fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,13 @@ jobs:
- 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
- template: templates/prepare_environment.yaml

- 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
Expand Down
Loading

0 comments on commit ca59e72

Please sign in to comment.