Skip to content

Commit 5d8953b

Browse files
author
Pascal Grange
committed
Workaround odd broken pipe when run in github actions
1 parent cd8e612 commit 5d8953b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_doc.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ TEST_PATTERN='```test'
44
OUTPUT_PATTERN='```output'
55
LANG=C.UTF-8
66

7-
export FORCE_COLOR=false
87
export STICK_TO_CWD=true
9-
BASH_UNIT="eval ./bash_unit"
10-
#BASH_UNIT="eval FORCE_COLOR=false ./bash_unit"
8+
BASH_UNIT="eval FORCE_COLOR=false ./bash_unit"
119

1210
prepare_tests() {
1311
mkdir /tmp/$$
@@ -21,14 +19,19 @@ prepare_tests() {
2119
while grep -E '^'"$TEST_PATTERN"'$' $remaining >/dev/null
2220
do
2321
((++block))
24-
run_doc_test $remaining $swap |& sed '$a\' > $test_output$block
22+
run_doc_test $remaining $swap |& sed '$a\' | work_around_github_action_problem > $test_output$block
2523
doc_to_output $remaining $swap > $expected_output$block
2624
eval 'function test_block_'"$(printf %02d $block)"'() {
2725
assert "diff -u '"$expected_output$block"' '"$test_output$block"'"
2826
}'
2927
done
3028
}
3129
30+
work_around_github_action_problem() {
31+
# I have no idea what is happening with these broken pipes on github actions
32+
grep -v '^/usr/bin/grep: write error: Broken pipe$'
33+
}
34+
3235
function run_doc_test() {
3336
local remaining="$1"
3437
local swap="$2"

0 commit comments

Comments
 (0)