From 5826b8b6383e0557f9d3830bcccf3a19c224040e Mon Sep 17 00:00:00 2001 From: Eric Swanson <64809312+ericswanson-dfinity@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:09:52 -0800 Subject: [PATCH] test: detect errors in command pipelines (#3513) In e2e test suite, `set -o pipefail` in order to detect errors anywhere in a command pipeline. --- e2e/tests-dfx/schema.bash | 2 +- e2e/utils/_.bash | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/tests-dfx/schema.bash b/e2e/tests-dfx/schema.bash index 3886840934..8cdad36b6c 100644 --- a/e2e/tests-dfx/schema.bash +++ b/e2e/tests-dfx/schema.bash @@ -19,6 +19,6 @@ teardown() { } @test "dfx schema still works with broken dfx.json" { - jq '.broken_key="blahblahblah"' dfx.json | sponge dfx.json + echo '{}' | jq '.broken_key="blahblahblah"' > dfx.json assert_command dfx schema } diff --git a/e2e/utils/_.bash b/e2e/utils/_.bash index 391305a7ce..3b340a73ed 100644 --- a/e2e/utils/_.bash +++ b/e2e/utils/_.bash @@ -1,4 +1,4 @@ -set -e +set -eo pipefail load ../utils/bats-support/load load ../utils/assertions load ../utils/webserver