[26/27] t9902: disable pipefail
diff mbox series

Message ID 95806f55e7e0ad1ac187ea162a74d5883fa86e67.1573779466.git.liu.denton@gmail.com
State New
Headers show
Series
  • t: general test cleanup + `set -o pipefail`
Related show

Commit Message

Denton Liu Nov. 15, 2019, 1:01 a.m. UTC
In a future patch, we plan on running tests with `set -o pipefail`.
However, these tests cannot run with pipefail. Since git-completion.bash
is not a testing script, it does not follow the same return code
conventions and it's expected that commands can fail within a pipeline.

Run `set +o pipefail` to disable pipefail in this script.

Note that this is being unconditionally run because this test will be
skipped if its not running on Bash.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 t/t9902-completion.sh | 6 ++++++
 1 file changed, 6 insertions(+)

Patch
diff mbox series

diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index e90ac565e1..75a512669e 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -7,6 +7,12 @@  test_description='test bash completion'
 
 . ./lib-bash.sh
 
+# These tests cannot run with pipefail. Since git-completion.bash is not
+# a testing script, it does not follow the same return code conventions
+# and it's expected that commands can fail within a pipeline. Ignore
+# these failures.
+set +o pipefail
+
 complete ()
 {
 	# do nothing