Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3c24b5b

Browse files
committed
Allow repetitive running of a specific tests via travis
1 parent cab07ad commit 3c24b5b

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ notifications:
2323

2424
env:
2525
- PG_VERSION=12 PG_BRANCH=REL_12_STABLE
26-
# - PG_VERSION=13 PG_BRANCH=master
26+
- PG_VERSION=12 PG_BRANCH=REL_12_STABLE TEST_CASE=test_ptrack_multiple_segments TEST_REPEATS=5

Dockerfile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN apt-get -yq install python python-pip python-virtualenv
77
# Environment
88
ENV PG_MAJOR=${PG_VERSION} PG_BRANCH=${PG_BRANCH}
99
ENV LANG=C.UTF-8 PGHOME=/pg/testdir/pgbin
10+
ENV MODE=${MODE} TEST_CASE=${TEST_CASE} TEST_REPEATS=${TEST_REPEATS}
1011

1112
# Make directories
1213
RUN mkdir -p /pg/testdir
@@ -21,4 +22,4 @@ WORKDIR /pg/testdir
2122
RUN chown -R postgres:postgres /pg/testdir
2223

2324
USER postgres
24-
ENTRYPOINT MODE=${MODE} /run.sh
25+
ENTRYPOINT /run.sh

make_dockerfile.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,27 @@ fi
1212

1313
if [ -z ${MODE+x} ]; then
1414
MODE=basic
15+
else
16+
echo MODE=${MODE}
17+
fi
18+
19+
if [ ! -z ${TEST_CASE+x} ]; then
20+
echo TEST_CASE=${TEST_CASE}
21+
fi
22+
23+
if [ ! -z ${TEST_REPEATS+x} ]; then
24+
echo TEST_REPEATS=${TEST_REPEATS}
25+
else
26+
TEST_REPEATS=1
1527
fi
1628

1729
echo PG_VERSION=${PG_VERSION}
1830
echo PG_BRANCH=${PG_BRANCH}
19-
echo MODE=${MODE}
2031

2132
sed \
2233
-e 's/${PG_VERSION}/'${PG_VERSION}/g \
2334
-e 's/${PG_BRANCH}/'${PG_BRANCH}/g \
2435
-e 's/${MODE}/'${MODE}/g \
36+
-e 's/${TEST_CASE}/'${TEST_CASE}/g \
37+
-e 's/${TEST_REPEATS}/'${TEST_REPEATS}/g \
2538
Dockerfile.in > Dockerfile

run_tests.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,9 @@ which pg_config
6565
echo "############### pg_config"
6666
pg_config
6767

68-
# Build and install pg_probackup (using PG_CPPFLAGS and SHLIB_LINK for gcov)
68+
# Build and install pg_probackup
6969
echo "############### Compiling and installing pg_probackup"
7070
cd pg_probackup # Go to pg_probackup dir
71-
# make USE_PGXS=1 PG_CPPFLAGS="-coverage" SHLIB_LINK="-coverage" top_srcdir=$CUSTOM_PG_SRC install
7271
make USE_PGXS=1 top_srcdir=$PG_SRC install
7372

7473
# Setup python environment
@@ -81,7 +80,14 @@ echo "############### Testing"
8180
if [ "$MODE" = "basic" ]; then
8281
export PG_PROBACKUP_TEST_BASIC=ON
8382
fi
84-
python -m unittest -v tests.ptrack
83+
84+
if [ -z ${TEST_CASE+x} ]; then
85+
python -m unittest -v tests.ptrack
86+
else
87+
for i in `seq $TEST_REPEATS`; do
88+
python -m unittest -v tests.ptrack.PtrackTest.$TEST_CASE
89+
done
90+
fi
8591

8692
# Generate *.gcov files
8793
# gcov src/*.c src/*.h

0 commit comments

Comments
 (0)