From 386edc666ec2a053b4d576fc4b2deeb46fe492b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sviatoslav=20Sydorenko=20=28=D0=A1=D0=B2=D1=8F=D1=82=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1=D0=B8=D0=B4=D0=BE=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE=29?= Date: Fri, 16 Feb 2024 21:26:16 +0100 Subject: [PATCH] Add macOS 14.3 to CI and `ansible-test` Additionally, this patch takes care of installing GPG within the `ansible-galaxy-collection` test when running under macOS 14 and higher. PR #82697 ci_complete --- .azure-pipelines/azure-pipelines.yml | 8 +++---- .../ansible-test-added-macos-14.3.yml | 6 ++++++ .../handlers/main.yml | 7 +++++++ .../tasks/setup_gpg.yml | 21 +++++++++++++++++++ .../ansible_test/_data/completion/remote.txt | 1 + 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/ansible-test-added-macos-14.3.yml create mode 100644 test/integration/targets/ansible-galaxy-collection/handlers/main.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 50f92313447..4337ae95523 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -77,8 +77,8 @@ stages: - template: templates/matrix.yml # context/target parameters: targets: - - name: macOS 13.2 - test: macos/13.2 + - name: macOS 14.3 + test: macos/14.3 - name: RHEL 9.3 py39 test: rhel/9.3@3.9 - name: RHEL 9.3 py311 @@ -91,8 +91,8 @@ stages: - template: templates/matrix.yml # context/controller parameters: targets: - - name: macOS 13.2 - test: macos/13.2 + - name: macOS 14.3 + test: macos/14.3 - name: RHEL 9.3 test: rhel/9.3 - name: FreeBSD 13.2 diff --git a/changelogs/fragments/ansible-test-added-macos-14.3.yml b/changelogs/fragments/ansible-test-added-macos-14.3.yml new file mode 100644 index 00000000000..85db65ccb1c --- /dev/null +++ b/changelogs/fragments/ansible-test-added-macos-14.3.yml @@ -0,0 +1,6 @@ +--- + +minor_changes: +- ansible-test - Added a macOS 14.3 remote VM. + +... diff --git a/test/integration/targets/ansible-galaxy-collection/handlers/main.yml b/test/integration/targets/ansible-galaxy-collection/handlers/main.yml new file mode 100644 index 00000000000..d58a516406b --- /dev/null +++ b/test/integration/targets/ansible-galaxy-collection/handlers/main.yml @@ -0,0 +1,7 @@ +- name: uninstall gpg + command: brew uninstall gpg + become: yes + become_user: >- + {{ brew_stat.stat.pw_name }} + environment: + HOMEBREW_NO_AUTO_UPDATE: True diff --git a/test/integration/targets/ansible-galaxy-collection/tasks/setup_gpg.yml b/test/integration/targets/ansible-galaxy-collection/tasks/setup_gpg.yml index ddc4d8a6b03..66fe22044ab 100644 --- a/test/integration/targets/ansible-galaxy-collection/tasks/setup_gpg.yml +++ b/test/integration/targets/ansible-galaxy-collection/tasks/setup_gpg.yml @@ -7,6 +7,27 @@ - absent - directory +- when: ansible_facts.distribution == 'MacOSX' + block: + - name: MACOS | Find brew binary + command: which brew + register: brew_which + + - name: MACOS | Get owner of brew binary + stat: + path: >- + {{ brew_which.stdout }} + register: brew_stat + + - command: brew install gpg + become: yes + become_user: >- + {{ brew_stat.stat.pw_name }} + environment: + HOMEBREW_NO_AUTO_UPDATE: True + notify: + - uninstall gpg + - name: get username for generating key command: whoami register: user diff --git a/test/lib/ansible_test/_data/completion/remote.txt b/test/lib/ansible_test/_data/completion/remote.txt index 0680ded7fd7..00b660dbc74 100644 --- a/test/lib/ansible_test/_data/completion/remote.txt +++ b/test/lib/ansible_test/_data/completion/remote.txt @@ -5,6 +5,7 @@ fedora become=sudo provider=aws arch=x86_64 freebsd/13.2 python=3.9,3.11 python_dir=/usr/local/bin become=su_sudo provider=aws arch=x86_64 freebsd python_dir=/usr/local/bin become=su_sudo provider=aws arch=x86_64 macos/13.2 python=3.11 python_dir=/usr/local/bin become=sudo provider=parallels arch=x86_64 +macos/14.3 python=3.11 python_dir=/usr/local/bin become=sudo provider=parallels arch=x86_64 macos python_dir=/usr/local/bin become=sudo provider=parallels arch=x86_64 rhel/9.3 python=3.9,3.11 become=sudo provider=aws arch=x86_64 rhel become=sudo provider=aws arch=x86_64