diff --git a/infra/azure/templates/fast_tests.yml b/infra/azure/templates/fast_tests.yml deleted file mode 100644 index ac26ce8f0b..0000000000 --- a/infra/azure/templates/fast_tests.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -parameters: - - name: distro - type: string - default: fedora-latest - - name: build_number - type: string - - name: ansible_version - type: string - default: "" - - name: target_python - type: string - default: "/usr/bin/python3" - -jobs: -- template: playbook_fast.yml - parameters: - group_number: 1 - number_of_groups: 1 - build_number: ${{ parameters.build_number }} - distro: ${{ parameters.distro }} - ansible_version: ${{ parameters.ansible_version }} - python_version: '< 3.12' - target_python: ${{ parameters.target_python }} - -# - template: pytest_tests.yml -# parameters: -# build_number: ${{ parameters.build_number }} -# distro: ${{ parameters.distro }} -# ansible_version: ${{ parameters.ansible_version }} -# python_version: '< 3.12' diff --git a/infra/azure/templates/galaxy_tests.yml b/infra/azure/templates/galaxy_tests.yml index 465097de2e..9464fba7ec 100644 --- a/infra/azure/templates/galaxy_tests.yml +++ b/infra/azure/templates/galaxy_tests.yml @@ -37,10 +37,14 @@ jobs: ansible_version: ${{ parameters.ansible_version }} python_version: '< 3.12' -# Temporarily disable due to issues with ansible docker plugin. -#- template: galaxy_pytest_script.yml -# parameters: -# build_number: ${{ parameters.build_number }} -# scenario: ${{ parameters.scenario }} -# ansible_version: ${{ parameters.ansible_version }} -# python_version: '< 3.12' +# Temporarily disabled due to ansible docker plugin issue. +# - template: playbook_tests.yml +# parameters: +# group_number: 3 +# number_of_groups: 3 +# build_number: ${{ parameters.build_number }} +# scenario: ${{ parameters.scenario }} +# ansible_version: ${{ parameters.ansible_version }} +# python_version: '< 3.12' +# filter_tests: ${{ parameters.filter_tests }} +# test_type: "not playbook" diff --git a/infra/azure/templates/group_tests.yml b/infra/azure/templates/group_tests.yml index 0d2fee49f2..39735ec366 100644 --- a/infra/azure/templates/group_tests.yml +++ b/infra/azure/templates/group_tests.yml @@ -44,9 +44,13 @@ jobs: filter_tests: ${{ parameters.filter_tests }} # Temporarily disabled due to ansible docker plugin issue. -#- template: pytest_tests.yml -# parameters: -# build_number: ${{ parameters.build_number }} -# scenario: ${{ parameters.scenario }} -# ansible_version: ${{ parameters.ansible_version }} -# python_version: '< 3.12' +# - template: playbook_tests.yml +# parameters: +# group_number: 3 +# number_of_groups: 3 +# build_number: ${{ parameters.build_number }} +# scenario: ${{ parameters.scenario }} +# ansible_version: ${{ parameters.ansible_version }} +# python_version: '< 3.12' +# filter_tests: ${{ parameters.filter_tests }} +# test_type: "not playbook" diff --git a/infra/azure/templates/playbook_fast.yml b/infra/azure/templates/playbook_fast.yml deleted file mode 100644 index 844b2b06fa..0000000000 --- a/infra/azure/templates/playbook_fast.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -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: - - template: templates/prepare_environment.yaml - - - script: | - . utils/set_test_modules - python3 utils/check_test_configuration.py ${{ parameters.distro }} - displayName: Check test configuration - - - 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() diff --git a/infra/azure/templates/playbook_tests.yml b/infra/azure/templates/playbook_tests.yml index 1beb8328ea..5de2646cfd 100644 --- a/infra/azure/templates/playbook_tests.yml +++ b/infra/azure/templates/playbook_tests.yml @@ -38,9 +38,14 @@ jobs: distro: ${{ parameters.distro }} ansible_version: ${{ parameters.ansible_version }} python_version: ${{ parameters.python_version }} - filter_tests: ${{ parameters.filter_tests }} - script: | + [ "${{ parameters.filter_tests }}" == "True" ] && . utils/set_test_modules + python3 utils/check_test_configuration.py ${{ parameters.distro }} + displayName: Check test configuration + + - script: | + [ "${{ parameters.filter_tests }}" == "True" ] && . utils/set_test_modules pytest \ -m "${{ parameters.test_type }}" \ --verbose \ diff --git a/infra/azure/templates/prepare_environment.yaml b/infra/azure/templates/prepare_environment.yaml index 58e06a8a97..077d40528e 100644 --- a/infra/azure/templates/prepare_environment.yaml +++ b/infra/azure/templates/prepare_environment.yaml @@ -11,9 +11,6 @@ parameters: default: 3.x - name: build_number type: string - - name: filter_tests - type: boolean - default: true steps: - task: UsePythonVersion@0 @@ -31,9 +28,3 @@ steps: - script: infra/image/start.sh ${{ parameters.distro }}-server displayName: Setup target container for ${{ parameters.distro }} - - - script: . utils/set_test_modules - condition: ${{ eq(parameters.filter_tests, true) }} - - - script: python3 utils/check_test_configuration.py ${{ parameters.distro }} - displayName: Check test configuration diff --git a/infra/azure/templates/pytest_tests.yml b/infra/azure/templates/pytest_tests.yml deleted file mode 100644 index 6469d2100c..0000000000 --- a/infra/azure/templates/pytest_tests.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -parameters: - - name: build_number - type: string - - name: distro - 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.distro }} - timeoutInMinutes: 240 - variables: - - template: variables.yaml - - template: variables_${{ parameters.distro }}.yaml - steps: - - template: templates/prepare_environment.yaml - parameters: - distro: ${{ parameters.distro }} - ansible_version: ${{ parameters.ansible_version }} - python_version: ${{ parameters.python_version }} - filter_tests: ${{ parameters.filter_tests }} - - - script: . utils/set_test_modules - condition: eq(parameters.filter_tests, true) - displayName: Filter tests - - - script: python3 utils/check_test_configuration.py ${{ parameters.distro }} - displayName: Check test configuration - - - script: | - pytest \ - -m "not playbook" \ - --verbose \ - --color=yes \ - --suppress-no-test-exit-code \ - --junit-xml=TEST-results-pytests.xml - displayName: Run tests - env: - ANSIBLE_ROLES_PATH: "${PWD}/roles" - ANSIBLE_LIBRARY: "${PWD}/plugins" - ANSIBLE_MODULE_UTILS: "${PWD}/plugins/module_utils" - IPA_SERVER_HOST: ansible-freeipa-tests - RUN_TESTS_IN_DOCKER: podman - IPA_DISABLED_MODULES: ${{ variables.ipa_disabled_modules }} - IPA_DISABLED_TESTS: ${{ variables.ipa_disabled_tests }} - IPA_VERBOSITY: "-vvv" - - - task: PublishTestResults@2 - inputs: - mergeTestResults: true - testRunTitle: PlaybookTests-Build${{ parameters.build_number }} - condition: succeededOrFailed()