Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 58f20e3

Browse files
committed
Update test-unit bundle to run race detector
It will run twice each package test, one without the race detector, one with. Signed-off-by: Vincent Demeester <[email protected]>
1 parent 5deb197 commit 58f20e3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

script/test-unit

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,28 @@ fi
2828

2929
TESTS_FAILED=()
3030

31+
set +e
3132
for dir in $TESTDIRS; do
3233
echo '+ go test' $TESTFLAGS "${LIBCOMPOSE_PKG}/${dir#./}"
3334
go test ${TESTFLAGS} "${LIBCOMPOSE_PKG}/${dir#./}"
3435
if [ $? != 0 ]; then
3536
TESTS_FAILED+=("$dir")
3637
echo
37-
echo "${RED}Tests failed: $dir${TEXTRESET}"
38+
echo "${RED}Tests failed: ${LIBCOMPOSE_PKG}${TEXTRESET}"
3839
sleep 1 # give it a second, so observers watching can take note
40+
else
41+
echo '+ go test -race' $TESTFLAGS "${LIBCOMPOSE_PKG}/${dir#./}"
42+
go test -race ${TESTFLAGS} "${LIBCOMPOSE_PKG}/${dir#./}"
43+
if [ $? != 0 ]; then
44+
TESTS_FAILED+=("$dir")
45+
echo
46+
echo "${RED}Tests failed (race): ${LIBCOMPOSE_PKG}${TEXTRESET}"
47+
sleep 1 # give it a second, so observers watching can take note
48+
fi
3949
fi
4050
done
51+
set -e
52+
4153
echo
4254

4355
# if some tests fail, we want the bundlescript to fail, but we want to

0 commit comments

Comments
 (0)