Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ansible/ansible.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSviatoslav Sydorenko <wk@sydorenko.org.ua>2022-11-01 18:10:05 +0300
committerGitHub <noreply@github.com>2022-11-01 18:10:05 +0300
commit6674c43edd203d1241507c4d857f555a7c844c18 (patch)
tree25ac2f1b09fc6e864c63ab959d64c7327b43d21f
parent6d9e2bc5e90a4db81f879f5e79b5470ea676f587 (diff)
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
-rw-r--r--changelogs/fragments/79263-runme-sh-logging-3cb482385bd59058.yaml10
-rwxr-xr-xtest/integration/targets/ansible-test-git/runme.sh2
-rwxr-xr-xtest/integration/targets/entry_points/runme.sh2
-rwxr-xr-xtest/integration/targets/include_when_parent_is_dynamic/runme.sh2
-rwxr-xr-xtest/integration/targets/include_when_parent_is_static/runme.sh2
-rwxr-xr-xtest/integration/targets/pyyaml/runme.sh2
-rwxr-xr-xtest/integration/targets/subversion/runme.sh2
-rwxr-xr-xtest/integration/targets/tags/runme.sh5
-rwxr-xr-xtest/integration/targets/test_core/runme.sh2
9 files changed, 18 insertions, 11 deletions
diff --git a/changelogs/fragments/79263-runme-sh-logging-3cb482385bd59058.yaml b/changelogs/fragments/79263-runme-sh-logging-3cb482385bd59058.yaml
new file mode 100644
index 00000000000..a5bc88ffe39
--- /dev/null
+++ b/changelogs/fragments/79263-runme-sh-logging-3cb482385bd59058.yaml
@@ -0,0 +1,10 @@
+---
+
+trivial:
+ - >-
+ integration tests — added command invocation logging via ``set -x``
+ to ``runme.sh`` scripts where it was missing and improved failing
+ fast in those scripts that use pipes (via ``set -o pipefail``).
+ See `PR #79263` https://github.com/ansible/ansible/pull/79263>`__.
+
+...
diff --git a/test/integration/targets/ansible-test-git/runme.sh b/test/integration/targets/ansible-test-git/runme.sh
index 7c956b4f158..04e88441c35 100755
--- a/test/integration/targets/ansible-test-git/runme.sh
+++ b/test/integration/targets/ansible-test-git/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/entry_points/runme.sh b/test/integration/targets/entry_points/runme.sh
index bb213694458..cabf153a248 100755
--- a/test/integration/targets/entry_points/runme.sh
+++ b/test/integration/targets/entry_points/runme.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-set -eu
+set -eu -o pipefail
source virtualenv.sh
set +x
unset PYTHONPATH
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 b136965f1fc..fa7a34516ac 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 33728bdf023..0b66f6bf093 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/pyyaml/runme.sh b/test/integration/targets/pyyaml/runme.sh
index 0361835a0d6..a664198c8fd 100755
--- a/test/integration/targets/pyyaml/runme.sh
+++ b/test/integration/targets/pyyaml/runme.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-set -eu
+set -eu -o pipefail
source virtualenv.sh
set +x
diff --git a/test/integration/targets/subversion/runme.sh b/test/integration/targets/subversion/runme.sh
index c39bdc0090d..8a4f0d02354 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 2984995209e..9da0b301619 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 c20c174132c..5daa5fe96f0 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 "${@}"