Skip to content

Commit d420542

Browse files
mark-i-mspastorino
authored andcommitted
hack around timeouts (#416)
1 parent bfe0a08 commit d420542

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ before_install:
88
- MAX_LINE_LENGTH=100 bash ci/check_line_lengths.sh src/**/*.md
99
install:
1010
- source ~/.cargo/env || true
11-
- bash ci/install.sh
11+
- bash -x ci/install.sh
1212
script:
13-
- mdbook build
13+
- bash -x ci/build-ignore-timeouts.sh
1414
- mdbook test
1515
notifications:
1616
email:

ci/build-ignore-timeouts.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
output=$(mktemp)
3+
4+
RUST_LOG=mdbook_linkcheck=debug mdbook build 2>&1 | tee $output
5+
6+
result=${PIPESTATUS[0]}
7+
8+
# if passed, great!
9+
if [ "$result" -eq "0" ] ; then
10+
exit 0 ;
11+
fi
12+
13+
errors=$(cat $output | sed -n 's/There \(was\|were\) \([0-9]\+\).*$/\2/p')
14+
timeouts=$(cat $output | grep "error while fetching" | wc -l)
15+
16+
# if all errors are timeouts, ignore them...
17+
if [ "$errors" -eq "$timeouts" ] ; then
18+
echo "Ignoring $timeouts timeouts";
19+
exit 0;
20+
else
21+
echo "Non-timeout errors found";
22+
exit 1;
23+
fi

0 commit comments

Comments
 (0)