Skip to content

Commit 7b699b9

Browse files
amanjeevmark-i-m
authored andcommitted
Revert "Removes timeout script so CI does not have false positives"
This reverts commit c3ed0a1.
1 parent dbe31d4 commit 7b699b9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

ci/build-ignore-timeouts.sh

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

0 commit comments

Comments
 (0)