travis: Enable pytest-test-groups to split tests across several runs

Adds two new environment variables TEST_GROUP_COUNT and TEST_GROUP to
split the integration tests into groups and run only a selected group.

This allows us to increase the TEST_GROUP_COUNT and add a new
TEST_GROUP to avoid bumping up against the time limit when running in
valgrind.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker 2017-12-21 14:12:51 +01:00 committed by Rusty Russell
parent 1a91786def
commit ab620c5068
2 changed files with 9 additions and 2 deletions

View File

@ -8,9 +8,11 @@ notifications:
env:
- NO_VALGRIND=1 ARCH=32 DEVELOPER=1 COMPILER=gcc
- NO_VALGRIND=1 ARCH=64 DEVELOPER=1 COMPILER=gcc
- NO_VALGRIND=0 ARCH=64 DEVELOPER=1 COMPILER=gcc
- NO_VALGRIND=0 ARCH=64 DEVELOPER=0 COMPILER=gcc
- NO_VALGRIND=1 ARCH=64 DEVELOPER=1 COMPILER=clang
- NO_VALGRIND=0 ARCH=64 DEVELOPER=1 COMPILER=gcc TEST_GROUP=1 TEST_GROUP_COUNT=3
- NO_VALGRIND=0 ARCH=64 DEVELOPER=1 COMPILER=gcc TEST_GROUP=2 TEST_GROUP_COUNT=3
- NO_VALGRIND=0 ARCH=64 DEVELOPER=1 COMPILER=gcc TEST_GROUP=3 TEST_GROUP_COUNT=3
# Trusty (aka 14.04) is way way too old, so run in docker...
script:

View File

@ -169,6 +169,11 @@ include devtools/Makefile
# Git doesn't maintain timestamps, so we only regen if git says we should.
CHANGED_FROM_GIT = [ x"`git log $@ | head -n1`" != x"`git log $< | head -n1`" -o x"`git diff $<`" != x"" ]
ifeq ($(TEST_GROUP_COUNT),)
TEST_GROUP=1
TEST_GROUP_COUNT=1
endif
check:
$(MAKE) pytest
@ -176,7 +181,7 @@ pytest: $(ALL_PROGRAMS)
ifndef PYTEST
PYTHONPATH=contrib/pylightning DEVELOPER=$(DEVELOPER) python3 tests/test_lightningd.py -f
else
PYTHONPATH=contrib/pylightning TEST_DEBUG=1 DEVELOPER=$(DEVELOPER) $(PYTEST) -vx tests/test_lightningd.py
PYTHONPATH=contrib/pylightning TEST_DEBUG=1 DEVELOPER=$(DEVELOPER) $(PYTEST) -vx tests/test_lightningd.py --test-group=$(TEST_GROUP) --test-group-count=$(TEST_GROUP_COUNT)
endif
# Keep includes in alpha order.