Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 782eb33

Browse files
committed
ci: docs: Check for failure properly
Fixes: #527 Signed-off-by: John Andersen <[email protected]>
1 parent 09b2f72 commit 782eb33

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.ci/run.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,19 @@ function run_docs() {
147147

148148
last_release=$("${PYTHON}" -m dffml service dev setuppy kwarg version setup.py)
149149

150+
# Log failed tests to file
151+
doctest_failures="$(mktemp)"
152+
TEMP_DIRS+=("${doctest_failures}")
153+
150154
# Doctests
151-
./scripts/doctest.sh
155+
./scripts/doctest.sh 2>&1 | tee "${doctest_failures}"
156+
157+
# Fail if any tests errored
158+
skipped=$(grep 'in test' "${doctest_failures}" | grep -v '0 failures in tests' | wc -l)
159+
if [ "$skipped" -ne 0 ]; then
160+
echo "Tests failed" >&2
161+
exit 1
162+
fi
152163

153164
# Fail if there are any changes to the Git repo
154165
changes=$(git status --porcelain | wc -l)

0 commit comments

Comments
 (0)