From fd0175034e7884efe59ce343ec746f1b120d5638 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Tue, 15 Oct 2024 12:57:59 -0300 Subject: [PATCH] fixup! upstream CI: Use start.sh script and environment template --- infra/azure/azure-pipelines.yml | 29 ++--- infra/azure/nightly.yml | 114 +++++++++--------- infra/azure/pr-pipeline.yml | 2 +- .../azure/templates/galaxy_pytest_script.yml | 65 ---------- infra/azure/templates/galaxy_script.yml | 14 +-- infra/azure/templates/galaxy_tests.yml | 12 +- infra/azure/templates/group_tests.yml | 10 +- infra/azure/templates/playbook_tests.yml | 5 +- 8 files changed, 97 insertions(+), 154 deletions(-) delete mode 100644 infra/azure/templates/galaxy_pytest_script.yml diff --git a/infra/azure/azure-pipelines.yml b/infra/azure/azure-pipelines.yml index b4127fb3dc..ce681c11bd 100644 --- a/infra/azure/azure-pipelines.yml +++ b/infra/azure/azure-pipelines.yml @@ -15,7 +15,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-latest + distro: fedora-latest ansible_version: "-core" filter_tests: false @@ -27,7 +27,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-latest + distro: fedora-latest ansible_version: "-core <2.14" filter_tests: false @@ -39,21 +39,21 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-latest + distro: fedora-latest ansible_version: "-core >=2.14,<2.15" filter_tests: false # Galaxy on Fedora -- stage: Galaxy_Fedora_Latest - dependsOn: [] - jobs: - - template: templates/galaxy_tests.yml - parameters: - build_number: $(Build.BuildNumber) - scenario: fedora-latest - ansible_version: "-core >=2.14,<2.15" - filter_tests: false +#- stage: Galaxy_Fedora_Latest +# dependsOn: [] +# jobs: +# - template: templates/galaxy_tests.yml +# parameters: +# build_number: $(Build.BuildNumber) +# distro: fedora-latest +# ansible_version: "-core >=2.14,<2.15" +# filter_tests: false # CentOS 9 Stream @@ -63,7 +63,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c9s + distro: c9s ansible_version: "-core >=2.14,<2.15" filter_tests: false @@ -75,6 +75,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c8s + distro: c8s ansible_version: "-core >=2.14,<2.15" + target_python: "/usr/libexec/platform-python" filter_tests: false diff --git a/infra/azure/nightly.yml b/infra/azure/nightly.yml index 3811c3cd7a..9a512d11e3 100644 --- a/infra/azure/nightly.yml +++ b/infra/azure/nightly.yml @@ -22,7 +22,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-latest + distro: fedora-latest ansible_version: "-core >=2.13,<2.14" filter_tests: false @@ -32,7 +32,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-latest + distro: fedora-latest ansible_version: "-core >=2.14,<2.15" filter_tests: false @@ -42,7 +42,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-latest + distro: fedora-latest ansible_version: "-core >=2.15,<2.16" filter_tests: false @@ -52,51 +52,51 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-latest + distro: fedora-latest ansible_version: "" filter_tests: false # Galaxy on Fedora -- stage: Galaxy_FedoraLatest_Ansible_Core_2_13 - dependsOn: [] - jobs: - - template: templates/galaxy_tests.yml - parameters: - 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: [] - jobs: - - template: templates/galaxy_tests.yml - parameters: - 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: [] - jobs: - - template: templates/galaxy_tests.yml - parameters: - build_number: $(Build.BuildNumber) - scenario: fedora-latest - ansible_version: "-core >=2.15,<2.16" - filter_tests: false - -- stage: Galaxy_FedoraLatest_Ansible_latest - dependsOn: [] - jobs: - - template: templates/galaxy_tests.yml - parameters: - build_number: $(Build.BuildNumber) - scenario: fedora-latest - ansible_version: "" - filter_tests: false +#- stage: Galaxy_FedoraLatest_Ansible_Core_2_13 +# dependsOn: [] +# jobs: +# - template: templates/galaxy_tests.yml +# parameters: +# build_number: $(Build.BuildNumber) +# distro: fedora-latest +# ansible_version: "-core >=2.13,<2.14" +# filter_tests: false +# +#- stage: Galaxy_FedoraLatest_Ansible_Core_2_14 +# dependsOn: [] +# jobs: +# - template: templates/galaxy_tests.yml +# parameters: +# build_number: $(Build.BuildNumber) +# distro: fedora-latest +# ansible_version: "-core >=2.14,<2.15" +# filter_tests: false +# +#- stage: Galaxy_FedoraLatest_Ansible_Core_2_15 +# dependsOn: [] +# jobs: +# - template: templates/galaxy_tests.yml +# parameters: +# build_number: $(Build.BuildNumber) +# distro: fedora-latest +# ansible_version: "-core >=2.15,<2.16" +# filter_tests: false +# +#- stage: Galaxy_FedoraLatest_Ansible_latest +# dependsOn: [] +# jobs: +# - template: templates/galaxy_tests.yml +# parameters: +# build_number: $(Build.BuildNumber) +# distro: fedora-latest +# ansible_version: "" +# filter_tests: false # Fedora Rawhide @@ -106,7 +106,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-rawhide + distro: fedora-rawhide ansible_version: "-core >=2.13,<2.14" filter_tests: false @@ -116,7 +116,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-rawhide + distro: fedora-rawhide ansible_version: "-core >=2.14,<2.15" filter_tests: false @@ -126,7 +126,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-rawhide + distro: fedora-rawhide ansible_version: "-core >=2.15,<2.16" filter_tests: false @@ -136,7 +136,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: fedora-rawhide + distro: fedora-rawhide ansible_version: "" filter_tests: false @@ -148,7 +148,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c9s + distro: c9s ansible_version: "-core >=2.13,<2.14" filter_tests: false @@ -158,7 +158,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c9s + distro: c9s ansible_version: "-core >=2.14,<2.15" filter_tests: false @@ -168,7 +168,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c9s + distro: c9s ansible_version: "-core >=2.15,<2.16" filter_tests: false @@ -178,7 +178,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c9s + distro: c9s ansible_version: "" filter_tests: false @@ -190,8 +190,9 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c8s + distro: c8s ansible_version: "-core >=2.13,<2.14" + target_python: "/usr/libexec/platform-python" filter_tests: false - stage: c8s_Ansible_Core_2_14 @@ -200,8 +201,9 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c8s + distro: c8s ansible_version: "-core >=2.14,<2.15" + target_python: "/usr/libexec/platform-python" filter_tests: false - stage: c8s_Ansible_Core_2_15 @@ -210,8 +212,9 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c8s + distro: c8s ansible_version: "-core >=2.15,<2.16" + target_python: "/usr/libexec/platform-python" filter_tests: false - stage: c8s_Ansible_latest @@ -220,6 +223,7 @@ stages: - template: templates/group_tests.yml parameters: build_number: $(Build.BuildNumber) - scenario: c8s + distro: c8s ansible_version: "" + target_python: "/usr/libexec/platform-python" filter_tests: false diff --git a/infra/azure/pr-pipeline.yml b/infra/azure/pr-pipeline.yml index 1c6cd14422..a41923490a 100644 --- a/infra/azure/pr-pipeline.yml +++ b/infra/azure/pr-pipeline.yml @@ -53,7 +53,7 @@ stages: 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 diff --git a/infra/azure/templates/galaxy_pytest_script.yml b/infra/azure/templates/galaxy_pytest_script.yml deleted file mode 100644 index 3b16416961..0000000000 --- a/infra/azure/templates/galaxy_pytest_script.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -parameters: - - name: build_number - type: string - - name: scenario - type: string - default: fedora-latest - - name: ansible_version - type: string - default: "" - - name: python_version - type: string - default: 3.x - -jobs: -- job: Test_PyTests - displayName: Run pytests on ${{ parameters.scenario }} - timeoutInMinutes: 240 - 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: | - cd ~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa - pytest \ - -m "not playbook" \ - --verbose \ - --color=yes \ - --junit-xml=TEST-results-pytests.xml - displayName: Run tests - env: - IPA_SERVER_HOST: ${{ parameters.scenario }} - RUN_TESTS_IN_DOCKER: true - IPA_VERBOSITY: "-vvv" - - - task: PublishTestResults@2 - inputs: - mergeTestResults: true - testRunTitle: PlaybookTests-Build${{ parameters.build_number }} - condition: succeededOrFailed() diff --git a/infra/azure/templates/galaxy_script.yml b/infra/azure/templates/galaxy_script.yml index a00dd0a55f..802c4cb259 100644 --- a/infra/azure/templates/galaxy_script.yml +++ b/infra/azure/templates/galaxy_script.yml @@ -6,7 +6,7 @@ parameters: - name: number_of_groups type: number default: 1 - - name: scenario + - name: distro type: string default: fedora-latest - name: ansible_version @@ -21,11 +21,11 @@ parameters: jobs: - job: Test_Group${{ parameters.group_number }} - displayName: Run playbook tests ${{ parameters.scenario }} (${{ parameters.group_number }}/${{ parameters.number_of_groups }}) + displayName: Run playbook tests ${{ parameters.distro }} (${{ parameters.group_number }}/${{ parameters.number_of_groups }}) timeoutInMinutes: 240 variables: - template: variables.yaml - - template: variables_${{ parameters.scenario }}.yaml + - template: variables_${{ parameters.distro }}.yaml steps: - task: UsePythonVersion@0 inputs: @@ -49,15 +49,15 @@ jobs: - script: | utils/build-galaxy-release.sh -i - molecule create -s ${{ parameters.scenario }} + molecule create -s ${{ parameters.distro }} retryCountOnTaskFailure: 5 displayName: Setup test container env: ANSIBLE_LIBRARY: ./molecule - script: | - python utils/check_test_configuration.py ${{ parameters.scenario }} - displayName: Check scenario test configuration + python utils/check_test_configuration.py ${{ parameters.distro }} + displayName: Check distro test configuration - script: | cd ~/.ansible/collections/ansible_collections/freeipa/ansible_freeipa @@ -71,7 +71,7 @@ jobs: --junit-xml=TEST-results-group-${{ parameters.group_number }}.xml displayName: Run playbook tests env: - IPA_SERVER_HOST: ${{ parameters.scenario }} + IPA_SERVER_HOST: ${{ parameters.distro }} RUN_TESTS_IN_DOCKER: true IPA_DISABLED_MODULES: ${{ variables.ipa_disabled_modules }} IPA_DISABLED_TESTS: ${{ variables.ipa_disabled_tests }} diff --git a/infra/azure/templates/galaxy_tests.yml b/infra/azure/templates/galaxy_tests.yml index 9464fba7ec..efbbefd958 100644 --- a/infra/azure/templates/galaxy_tests.yml +++ b/infra/azure/templates/galaxy_tests.yml @@ -1,6 +1,6 @@ --- parameters: - - name: scenario + - name: distro type: string default: fedora-latest - name: build_number @@ -15,7 +15,7 @@ jobs: group_number: 1 number_of_groups: 3 build_number: ${{ parameters.build_number }} - scenario: ${{ parameters.scenario }} + distro: ${{ parameters.distro }} ansible_version: ${{ parameters.ansible_version }} python_version: '< 3.12' @@ -24,7 +24,7 @@ jobs: group_number: 2 number_of_groups: 3 build_number: ${{ parameters.build_number }} - scenario: ${{ parameters.scenario }} + distro: ${{ parameters.distro }} ansible_version: ${{ parameters.ansible_version }} python_version: '< 3.12' @@ -33,17 +33,17 @@ jobs: group_number: 3 number_of_groups: 3 build_number: ${{ parameters.build_number }} - scenario: ${{ parameters.scenario }} + distro: ${{ parameters.distro }} ansible_version: ${{ parameters.ansible_version }} python_version: '< 3.12' # Temporarily disabled due to ansible docker plugin issue. -# - template: playbook_tests.yml +# - template: galaxy_script.yml # parameters: # group_number: 3 # number_of_groups: 3 # build_number: ${{ parameters.build_number }} -# scenario: ${{ parameters.scenario }} +# distro: ${{ parameters.distro }} # ansible_version: ${{ parameters.ansible_version }} # python_version: '< 3.12' # filter_tests: ${{ parameters.filter_tests }} diff --git a/infra/azure/templates/group_tests.yml b/infra/azure/templates/group_tests.yml index bab63efdcf..fd85ba4882 100644 --- a/infra/azure/templates/group_tests.yml +++ b/infra/azure/templates/group_tests.yml @@ -1,6 +1,6 @@ --- parameters: - - name: scenario + - name: distro type: string default: fedora-latest - name: build_number @@ -18,7 +18,7 @@ jobs: group_number: 1 number_of_groups: 3 build_number: ${{ parameters.build_number }} - scenario: ${{ parameters.scenario }} + distro: ${{ parameters.distro }} ansible_version: ${{ parameters.ansible_version }} python_version: '< 3.12' filter_tests: ${{ parameters.filter_tests }} @@ -28,7 +28,7 @@ jobs: group_number: 2 number_of_groups: 3 build_number: ${{ parameters.build_number }} - scenario: ${{ parameters.scenario }} + distro: ${{ parameters.distro }} ansible_version: ${{ parameters.ansible_version }} python_version: '< 3.12' filter_tests: ${{ parameters.filter_tests }} @@ -38,7 +38,7 @@ jobs: group_number: 3 number_of_groups: 3 build_number: ${{ parameters.build_number }} - scenario: ${{ parameters.scenario }} + distro: ${{ parameters.distro }} ansible_version: ${{ parameters.ansible_version }} python_version: '< 3.12' filter_tests: ${{ parameters.filter_tests }} @@ -49,7 +49,7 @@ jobs: # group_number: 3 # number_of_groups: 3 # build_number: ${{ parameters.build_number }} -# scenario: ${{ parameters.scenario }} +# distro: ${{ parameters.distro }} # ansible_version: ${{ parameters.ansible_version }} # python_version: '< 3.12' # filter_tests: ${{ parameters.filter_tests }} diff --git a/infra/azure/templates/playbook_tests.yml b/infra/azure/templates/playbook_tests.yml index 5de2646cfd..a0f6160cdd 100644 --- a/infra/azure/templates/playbook_tests.yml +++ b/infra/azure/templates/playbook_tests.yml @@ -17,6 +17,9 @@ parameters: default: 3.x - name: build_number type: string + - name: target_python + type: string + default: "/usr/bin/python3" - name: filter_tests type: boolean default: true @@ -62,7 +65,7 @@ jobs: IPA_DISABLED_MODULES: ${{ variables.ipa_disabled_modules }} IPA_DISABLED_TESTS: ${{ variables.ipa_disabled_tests }} IPA_VERBOSITY: "-vvv" - # IPA_PYTHON_PATH: ${{ parameters.target_python }} + IPA_PYTHON_PATH: ${{ parameters.target_python }} - task: PublishTestResults@2 inputs: