From 7fec0b69a082aaeec72fee0612766aa42f6b1b4d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 18 Apr 2024 07:52:35 +0200 Subject: Merging upstream version 9.4.0+dfsg. Signed-off-by: Daniel Baumann --- .../hcloud/.azure-pipelines/azure-pipelines.yml | 184 ++++++++++++++------- .../.azure-pipelines/scripts/aggregate-coverage.sh | 8 +- .../.azure-pipelines/scripts/combine-coverage.py | 27 ++- .../.azure-pipelines/scripts/publish-codecov.sh | 26 +-- .../.azure-pipelines/scripts/report-coverage.sh | 10 +- .../hcloud/.azure-pipelines/scripts/run-tests.sh | 24 +-- .../.azure-pipelines/scripts/time-command.py | 11 +- .../hcloud/.azure-pipelines/templates/matrix.yml | 14 +- .../hcloud/.azure-pipelines/templates/test.yml | 68 ++++---- 9 files changed, 220 insertions(+), 152 deletions(-) (limited to 'ansible_collections/hetzner/hcloud/.azure-pipelines') diff --git a/ansible_collections/hetzner/hcloud/.azure-pipelines/azure-pipelines.yml b/ansible_collections/hetzner/hcloud/.azure-pipelines/azure-pipelines.yml index d55524f27..8300381b4 100644 --- a/ansible_collections/hetzner/hcloud/.azure-pipelines/azure-pipelines.yml +++ b/ansible_collections/hetzner/hcloud/.azure-pipelines/azure-pipelines.yml @@ -1,22 +1,20 @@ trigger: batch: true branches: - include: - - main + include: [main, stable-1] pr: autoCancel: true + drafts: false branches: - include: - - main + include: [main, stable-1] schedules: - cron: 0 9 * * * displayName: Nightly always: true branches: - include: - - main + include: [main, stable-1] variables: - name: checkoutPath @@ -26,20 +24,20 @@ variables: - name: pipelinesCoverage value: coverage - name: entryPoint - value: tests/utils/shippable/shippable.sh + value: tests/utils/ci.sh - name: fetchDepth value: 0 resources: containers: - container: default - image: quay.io/ansible/azure-pipelines-test-container:3.0.0 + image: quay.io/ansible/azure-pipelines-test-container:4.0.1 pool: Standard stages: -### Sanity - - stage: Ansible_devel + ### Sanity + - stage: Sanity_devel displayName: Sanity devel dependsOn: [] jobs: @@ -47,9 +45,29 @@ stages: parameters: targets: - name: Sanity - test: 'devel/sanity/1' + test: devel/sanity - - stage: Ansible_2_14 + - stage: Sanity_2_16 + displayName: Sanity 2.16 + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + targets: + - name: Sanity + test: 2.16/sanity + + - stage: Sanity_2_15 + displayName: Sanity 2.15 + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + targets: + - name: Sanity + test: 2.15/sanity + + - stage: Sanity_2_14 displayName: Sanity 2.14 dependsOn: [] jobs: @@ -57,8 +75,9 @@ stages: parameters: targets: - name: Sanity - test: '2.14/sanity/1' - - stage: Ansible_2_13 + test: 2.14/sanity + + - stage: Sanity_2_13 displayName: Sanity 2.13 dependsOn: [] jobs: @@ -66,82 +85,133 @@ stages: parameters: targets: - name: Sanity - test: '2.13/sanity/1' - - stage: Ansible_2_12 - displayName: Sanity 2.12 + test: 2.13/sanity + + ### Units + - stage: Units_devel + displayName: Units devel dependsOn: [] jobs: - template: templates/matrix.yml parameters: targets: - - name: Sanity - test: '2.12/sanity/1' + - name: (py3.12) + test: devel/units/3.12 + + - stage: Units_2_16 + displayName: Units 2.16 + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + targets: + - name: (py3.10) + test: 2.16/units/3.10 + - stage: Units_2_15 + displayName: Units 2.15 + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + targets: + - name: (py3.9) + test: 2.15/units/3.9 + + - stage: Units_2_14 + displayName: Units 2.14 + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + targets: + - name: (py3.9) + test: 2.14/units/3.9 + + - stage: Units_2_13 + displayName: Units 2.13 + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + targets: + - name: (py3.8) + test: 2.13/units/3.8 + + ## Integration + - stage: Integration_devel + displayName: Integration devel + dependsOn: [] + jobs: + - template: templates/matrix.yml + parameters: + groups: [1, 2, 3] + targets: + - name: (py3.12) + test: devel/integration/3.12 -## Integration tests (remote) - - stage: Hetzner_devel - displayName: Hetzner devel + - stage: Integration_2_16 + displayName: Integration 2.16 dependsOn: [] jobs: - template: templates/matrix.yml parameters: - groups: - - 1 - - 2 + groups: [1, 2, 3] targets: - - name: hcloud - test: 'devel/hcloud/3.9' + - name: (py3.10) + test: 2.16/integration/3.10 - - stage: Hetzner_2_14 - displayName: Hetzner 2.14 + - stage: Integration_2_15 + displayName: Integration 2.15 dependsOn: [] jobs: - template: templates/matrix.yml parameters: - groups: - - 1 - - 2 + groups: [1, 2, 3] targets: - - name: hcloud - test: '2.14/hcloud/3.9' + - name: (py3.9) + test: 2.15/integration/3.9 - - stage: Hetzner_2_13 - displayName: Hetzner 2.13 + - stage: Integration_2_14 + displayName: Integration 2.14 dependsOn: [] jobs: - template: templates/matrix.yml parameters: - groups: - - 1 - - 2 + groups: [1, 2, 3] targets: - - name: hcloud - test: '2.13/hcloud/3.9' + - name: (py3.9) + test: 2.14/integration/3.9 - - stage: Hetzner_2_12 - displayName: Hetzner 2.12 + - stage: Integration_2_13 + displayName: Integration 2.13 dependsOn: [] jobs: - template: templates/matrix.yml parameters: - groups: - - 1 - - 2 + groups: [1, 2, 3] targets: - - name: hcloud - test: '2.12/hcloud/3.9' + - name: (py3.8) + test: 2.13/integration/3.8 -### Finally + ### Finally - stage: Summary condition: succeededOrFailed() dependsOn: - - Ansible_devel - - Ansible_2_14 - - Ansible_2_13 - - Ansible_2_12 - - Hetzner_devel - - Hetzner_2_14 - - Hetzner_2_13 - - Hetzner_2_12 + - Sanity_devel + - Sanity_2_16 + - Sanity_2_15 + - Sanity_2_14 + - Sanity_2_13 + - Units_devel + - Units_2_16 + - Units_2_15 + - Units_2_14 + - Units_2_13 + - Integration_devel + - Integration_2_16 + - Integration_2_15 + - Integration_2_14 + - Integration_2_13 jobs: - template: templates/coverage.yml diff --git a/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/aggregate-coverage.sh b/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/aggregate-coverage.sh index f3113dd0a..c196ab014 100755 --- a/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/aggregate-coverage.sh +++ b/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/aggregate-coverage.sh @@ -13,8 +13,8 @@ options=(--venv --venv-system-site-packages --color -v) ansible-test coverage combine --export "${agent_temp_directory}/coverage/" "${options[@]}" -if ansible-test coverage analyze targets generate --help >/dev/null 2>&1; then - # Only analyze coverage if the installed version of ansible-test supports it. - # Doing so allows this script to work unmodified for multiple Ansible versions. - ansible-test coverage analyze targets generate "${agent_temp_directory}/coverage/coverage-analyze-targets.json" "${options[@]}" +if ansible-test coverage analyze targets generate --help > /dev/null 2>&1; then + # Only analyze coverage if the installed version of ansible-test supports it. + # Doing so allows this script to work unmodified for multiple Ansible versions. + ansible-test coverage analyze targets generate "${agent_temp_directory}/coverage/coverage-analyze-targets.json" "${options[@]}" fi diff --git a/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/combine-coverage.py b/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/combine-coverage.py index 506ade646..bab3c4226 100755 --- a/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/combine-coverage.py +++ b/ansible_collections/hetzner/hcloud/.azure-pipelines/scripts/combine-coverage.py @@ -7,8 +7,7 @@ Keep in mind that Azure Pipelines does not enforce unique job display names (onl It is up to pipeline authors to avoid name collisions when deviating from the recommended format. """ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type +from __future__ import annotations import os import re @@ -20,12 +19,12 @@ def main(): """Main program entry point.""" source_directory = sys.argv[1] - if '/ansible_collections/' in os.getcwd(): + if "/ansible_collections/" in os.getcwd(): output_path = "tests/output" else: output_path = "test/results" - destination_directory = os.path.join(output_path, 'coverage') + destination_directory = os.path.join(output_path, "coverage") if not os.path.exists(destination_directory): os.makedirs(destination_directory) @@ -34,27 +33,27 @@ def main(): count = 0 for name in os.listdir(source_directory): - match = re.search('^Coverage (?P[0-9]+) (?P