Skip to content

Commit 8859948

Browse files
committed
TEST/MEDIUM: allow to pass multiple test names in $TESTNAME
This is useful to quickly make sure your tests are passing before or after other tests.
1 parent 3f47dc8 commit 8859948

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.aspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ allowed:
200200
- syslog
201201
- textarea
202202
- tcp
203+
- testname
203204
- timeseries
204205
- tls
205206
- tooltip

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ build:
3737

3838
.PHONY: e2e
3939
e2e: build
40-
TESTNAME=$(TESTNAME) TESTNUMBER=$(TESTNUMBER) TESTDESCRIPTION="$(TESTDESCRIPTION)" SKIP_CLEANUP=$(SKIP_CLEANUP) PREWIPE=$(PREWIPE) HAPROXY_VERSION=$(HAPROXY_VERSION) ./e2e/run.bash
40+
TESTNAME="$(TESTNAME)" TESTNUMBER=$(TESTNUMBER) TESTDESCRIPTION="$(TESTDESCRIPTION)" SKIP_CLEANUP=$(SKIP_CLEANUP) PREWIPE=$(PREWIPE) HAPROXY_VERSION=$(HAPROXY_VERSION) ./e2e/run.bash
4141

4242
.PHONY: generate-parent-aliases_no_formatting
4343
generate-parent-aliases_no_formatting:

e2e/run.bash

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ fi
112112
trap dump_logs ERR
113113

114114
echo '>>> Starting test suite'
115-
if [ ! -z $TESTNAME ]; then
116-
bats -t "${E2E_DIR}"/tests/${TESTNAME}
115+
if [ -n "$TESTNAME" ]; then
116+
# Small hack to allow selecting multiple test directories.
117+
pfx() { for i;do echo "$E2E_DIR/tests/$i"; done; }
118+
bats -t $(pfx $TESTNAME)
117119
elif [ ! -z $TESTPART ]; then
118120
set +e
119121
echo $TESTPART | grep -q -e "[[:digit:]]/[[:digit:]]"

0 commit comments

Comments
 (0)