From 7f17759bfebb4bce227c7a208bdf0a585064bf44 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 3 Feb 2026 17:08:59 -0800 Subject: [PATCH] Integration test updates for PowerShell support (#86519) Minor test additions/updates to prepare for improved PowerShell support in ansible-test. --- .../ns/col/tests/integration/targets/installed/runme.sh | 4 ++-- .../targets/ansible-test-sanity-validate-modules/runme.sh | 2 ++ test/integration/targets/powershell/aliases | 3 +++ test/integration/targets/powershell/tasks/main.yml | 8 ++++++++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 test/integration/targets/powershell/aliases create mode 100644 test/integration/targets/powershell/tasks/main.yml diff --git a/test/integration/targets/ansible-test-installed/ansible_collections/ns/col/tests/integration/targets/installed/runme.sh b/test/integration/targets/ansible-test-installed/ansible_collections/ns/col/tests/integration/targets/installed/runme.sh index 9de3820a31c..e5b425af1fe 100755 --- a/test/integration/targets/ansible-test-installed/ansible_collections/ns/col/tests/integration/targets/installed/runme.sh +++ b/test/integration/targets/ansible-test-installed/ansible_collections/ns/col/tests/integration/targets/installed/runme.sh @@ -4,8 +4,8 @@ set -eux -# The third PATH entry is the injected bin directory created by ansible-test. -bin_dir="$(python -c 'import os; print(os.environ["PATH"].split(":")[2])')" +# The PATH entry ending in "-bin" is the injected bin directory created by ansible-test. +bin_dir="$(python -c 'import os; print([path for path in os.environ["PATH"].split(":") if path.endswith("-bin")][0])')" while IFS= read -r name do diff --git a/test/integration/targets/ansible-test-sanity-validate-modules/runme.sh b/test/integration/targets/ansible-test-sanity-validate-modules/runme.sh index 5e2365ab259..132f2f9d8c6 100755 --- a/test/integration/targets/ansible-test-sanity-validate-modules/runme.sh +++ b/test/integration/targets/ansible-test-sanity-validate-modules/runme.sh @@ -25,6 +25,8 @@ if ! command -V pwsh; then exit 0 fi +pwsh --version + # Use a PowerShell-only collection to verify that validate-modules does not load the collection loader multiple times. ansible-test sanity --test validate-modules --color --truncate 0 "${@}" diff --git a/test/integration/targets/powershell/aliases b/test/integration/targets/powershell/aliases new file mode 100644 index 00000000000..d79956515e8 --- /dev/null +++ b/test/integration/targets/powershell/aliases @@ -0,0 +1,3 @@ +context/target +gather_facts/no +shippable/posix/group2 diff --git a/test/integration/targets/powershell/tasks/main.yml b/test/integration/targets/powershell/tasks/main.yml new file mode 100644 index 00000000000..3671f098dbb --- /dev/null +++ b/test/integration/targets/powershell/tasks/main.yml @@ -0,0 +1,8 @@ +- name: Get PowerShell version + command: pwsh --version + register: powershell_version + failed_when: false + +- name: Show PowerShell Version + debug: + msg: "{{ powershell_version.stdout }}"