From f170aa6c14bc4b3d4030258f034c1f8b0ae5c8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bergstr=C3=B6m?= Date: Fri, 15 Apr 2016 12:15:40 +0900 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/6208 Reviewed-By: Rod Vagg Reviewed-By: Myles Borins Reviewed-By: Rich Trott Reviewed-By: Ben Noordhuis --- Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3668121267348a..1edbb789291fe6 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,12 @@ PREFIX ?= /usr/local FLAKY_TESTS ?= run TEST_CI_ARGS ?= STAGINGSERVER ?= node-www - OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]') +ifdef JOBS + PARALLEL_ARGS = -j $(JOBS) +endif + ifdef QUICKCHECK QUICKCHECK_ARG := --quickcheck endif @@ -168,7 +171,8 @@ test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind test-ci: | build-addons - $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=$(FLAKY_TESTS) \ + $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ + --mode=release --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) addons message parallel sequential test-release: test-build @@ -607,8 +611,9 @@ jslint: tools/eslint-rules tools/jslint.js jslint-ci: - $(NODE) tools/jslint.js -f tap -o test-eslint.tap benchmark lib src test \ - tools/doc tools/eslint-rules tools/jslint.js + $(NODE) tools/jslint.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \ + benchmark lib src test tools/doc \ + tools/eslint-rules tools/jslint.js CPPLINT_EXCLUDE ?= CPPLINT_EXCLUDE += src/node_lttng.cc