Skip to content

Commit f49a1d0

Browse files
committed
build: allow test-ci to run tests in parallel
Run tests in parallel if the environment variable JOBS (which should contain a number of parallel jobs) is set. PR-URL: #6208 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 4a74fc9 commit f49a1d0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ PREFIX ?= /usr/local
88
FLAKY_TESTS ?= run
99
TEST_CI_ARGS ?=
1010
STAGINGSERVER ?= node-www
11-
1211
OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]')
1312

13+
ifdef JOBS
14+
PARALLEL_ARGS = -j $(JOBS)
15+
endif
16+
1417
ifdef QUICKCHECK
1518
QUICKCHECK_ARG := --quickcheck
1619
endif
@@ -168,7 +171,8 @@ test-all-valgrind: test-build
168171
$(PYTHON) tools/test.py --mode=debug,release --valgrind
169172

170173
test-ci: | build-addons
171-
$(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=$(FLAKY_TESTS) \
174+
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
175+
--mode=release --flaky-tests=$(FLAKY_TESTS) \
172176
$(TEST_CI_ARGS) addons message parallel sequential
173177

174178
test-release: test-build
@@ -607,8 +611,9 @@ jslint:
607611
tools/eslint-rules tools/jslint.js
608612

609613
jslint-ci:
610-
$(NODE) tools/jslint.js -f tap -o test-eslint.tap benchmark lib src test \
611-
tools/doc tools/eslint-rules tools/jslint.js
614+
$(NODE) tools/jslint.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
615+
benchmark lib src test tools/doc \
616+
tools/eslint-rules tools/jslint.js
612617

613618
CPPLINT_EXCLUDE ?=
614619
CPPLINT_EXCLUDE += src/node_lttng.cc

0 commit comments

Comments
 (0)