From de7fe7814ae00274b866d31aaea11ef8f7009936 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 4 Nov 2022 04:39:55 +0100 Subject: [2.11] Log `runme.sh` execution in integration tests (#79285) * Log `runme.sh` execution in integration tests (#79263) * Log `runme.sh` execution in integration tests This patch adds `set -x` where it's missing in the integration tests. It also enables `pipefail` in `runme.sh` scripts that use pipes. * Add a change note for PR #79263 (cherry picked from commit 6674c43edd203d1241507c4d857f555a7c844c18) * Delete a bad PR #79263 change note (cherry picked from commit 9cfb3f73e8d7f910e226de3aebe6f9b9b18327ec) --- test/integration/targets/ansible-test/runme.sh | 2 +- test/integration/targets/include_when_parent_is_dynamic/runme.sh | 2 +- test/integration/targets/include_when_parent_is_static/runme.sh | 2 +- test/integration/targets/subversion/runme.sh | 2 +- test/integration/targets/tags/runme.sh | 5 +---- test/integration/targets/test_core/runme.sh | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/test/integration/targets/ansible-test/runme.sh b/test/integration/targets/ansible-test/runme.sh index 7c956b4f15..04e88441c3 100755 --- a/test/integration/targets/ansible-test/runme.sh +++ b/test/integration/targets/ansible-test/runme.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -eu -o pipefail +set -eux -o pipefail # tests must be executed outside of the ansible source tree # otherwise ansible-test will test the ansible source instead of the test collection diff --git a/test/integration/targets/include_when_parent_is_dynamic/runme.sh b/test/integration/targets/include_when_parent_is_dynamic/runme.sh index b136965f1f..fa7a34516a 100755 --- a/test/integration/targets/include_when_parent_is_dynamic/runme.sh +++ b/test/integration/targets/include_when_parent_is_dynamic/runme.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -eu +set -eux ansible-playbook playbook.yml "$@" > output.log 2>&1 || true diff --git a/test/integration/targets/include_when_parent_is_static/runme.sh b/test/integration/targets/include_when_parent_is_static/runme.sh index 33728bdf02..0b66f6bf09 100755 --- a/test/integration/targets/include_when_parent_is_static/runme.sh +++ b/test/integration/targets/include_when_parent_is_static/runme.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -eu +set -eux ansible-playbook playbook.yml "$@" > output.log 2>&1 || true diff --git a/test/integration/targets/subversion/runme.sh b/test/integration/targets/subversion/runme.sh index f505e58168..66fa771a30 100755 --- a/test/integration/targets/subversion/runme.sh +++ b/test/integration/targets/subversion/runme.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -eu +set -eux -o pipefail cleanup() { echo "Cleanup" diff --git a/test/integration/targets/tags/runme.sh b/test/integration/targets/tags/runme.sh index 2984995209..9da0b30161 100755 --- a/test/integration/targets/tags/runme.sh +++ b/test/integration/targets/tags/runme.sh @@ -1,9 +1,6 @@ #!/usr/bin/env bash -set -eu - -# Using set -x for this test causes the Shippable console to stop receiving updates and the job to time out for macOS. -# Once that issue is resolved the set -x option can be added above. +set -eux -o pipefail # Run these using en_US.UTF-8 because list-tasks is a user output function and so it tailors its output to the # user's locale. For unicode tags, this means replacing non-ascii chars with "?" diff --git a/test/integration/targets/test_core/runme.sh b/test/integration/targets/test_core/runme.sh index c20c174132..5daa5fe96f 100755 --- a/test/integration/targets/test_core/runme.sh +++ b/test/integration/targets/test_core/runme.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -eu +set -eux ANSIBLE_ROLES_PATH=../ ansible-playbook --vault-password-file vault-password runme.yml -i inventory "${@}" -- cgit v1.2.1