From 3c8d404a82563fa2c6471ed1423d47a7b37dd731 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 46b4bbf338f29e..02b8aa19b1bbb8 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 @@ -596,8 +600,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