Skip to content

Commit 30cc8d5

Browse files
committed
Try to set proper exit code if tests failed
1 parent 19a5ddf commit 30cc8d5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Build Status](https://travis-ci.com/postgrespro/ptrack.svg?branch=master)](https://travis-ci.com/postgrespro/ptrack)
2+
[![codecov](https://codecov.io/gh/postgrespro/ptrack/branch/master/graph/badge.svg)](https://codecov.io/gh/postgrespro/ptrack)
23
[![GitHub release](https://img.shields.io/github/v/release/postgrespro/ptrack?include_prereleases)](https://github.com/postgrespro/ptrack/releases/latest)
34

45
# ptrack

run_tests.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77

88
PG_SRC=$PWD/postgres
9+
status=0
910

1011
# # Here PG_VERSION is provided by postgres:X-alpine docker image
1112
# curl "https://ftp.postgresql.org/pub/source/v$PG_VERSION/postgresql-$PG_VERSION.tar.bz2" -o postgresql.tar.bz2
@@ -82,10 +83,10 @@ if [ "$MODE" = "basic" ]; then
8283
fi
8384

8485
if [ "$TEST_CASE" = "all" ]; then
85-
python -m unittest -v tests.ptrack
86+
python -m unittest -v tests.ptrack || status=$?
8687
else
8788
for i in `seq $TEST_REPEATS`; do
88-
python -m unittest -v tests.ptrack.PtrackTest.$TEST_CASE
89+
python -m unittest -v tests.ptrack.PtrackTest.$TEST_CASE || status=$?
8990
done
9091
fi
9192

@@ -97,3 +98,6 @@ gcov src/*.c src/*.h
9798

9899
# Send coverage stats to Codecov
99100
bash <(curl -s https://codecov.io/bash)
101+
102+
# Something went wrong, exit with code 1
103+
if [ $status -ne 0 ]; then exit 1; fi

0 commit comments

Comments
 (0)