Skip to content

Commit 32e89d5

Browse files
szachovyCopilot
andcommitted
Restore pipefail in Tests workflow to fail on non-zero exit codes
The hashicorp/setup-terraform action with terraform_wrapper enabled (default) overrides the bash shell from 'bash -eo pipefail' to 'bash -e', stripping pipefail. This caused pipe commands like 'ansible-playbook ... | tee ...' to swallow non-zero exit codes, letting the CI job pass despite Ansible test failures. Fix by disabling terraform_wrapper (not needed since we don't use terraform outputs in GitHub Actions) and adding explicit set -o pipefail to steps that use pipes as defense-in-depth. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4b52a3d commit 32e89d5

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
- uses: "hashicorp/setup-terraform@v3"
3333
with:
3434
terraform_version: "1.0.10"
35+
terraform_wrapper: false
3536
- uses: "actions/setup-python@v3"
3637
with:
3738
python-version: "3.10.12"
@@ -49,6 +50,7 @@ jobs:
4950

5051
- name: "Build and pre-load service images into test containers"
5152
run: |
53+
set -o pipefail
5254
build_and_load() {
5355
local image_name="$1"
5456
local build_context="$2"
@@ -71,6 +73,7 @@ jobs:
7173
7274
- name: "Run Ansible testsuite"
7375
run: |
76+
set -o pipefail
7477
ansible-playbook --inventory inventory.yml deploy.yml \
7578
2>&1 | tee -a /tmp/superset_cluster_testsuite.log
7679
working-directory: "${{ env.ANSIBLE_WORKING_DIRECTORY }}"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4444
* Made `create_directory()` idempotent to support deployment re-runs. (#35)
4545
* Added default inventory directive to `ansible.cfg`. (#42)
4646
* Fixed Publish workflow `write_package` permission denied by adding OCI source labels for GHCR repository linking. (#99)
47+
* Restore `pipefail` in Tests workflow to propagate non-zero exit codes through pipes.
4748

4849
## 1.0 - 2024-10-13
4950

0 commit comments

Comments
 (0)