From b2692d94b3968ca82720841a61d4d31e7e253da9 Mon Sep 17 00:00:00 2001 From: Duda Dornelles Date: Tue, 3 Feb 2015 12:36:10 -0200 Subject: Auto-detecting the number of cores to run integration tests in parallel --- service/go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'service/go') diff --git a/service/go b/service/go index ec6a65f6..d23adf4f 100755 --- a/service/go +++ b/service/go @@ -1,5 +1,15 @@ #!/bin/bash +NUM_OF_CORES='' + +function resolveNumOfCores { + if [ "$(uname)" == "Darwin" ]; then + NUM_OF_CORES="$(sysctl -n hw.ncpu)" + else + NUM_OF_CORES="$(nproc)" + fi +} + function setuppy { pip install -r test_requirements.txt python setup.py develop $* @@ -14,7 +24,9 @@ function setupjs { } function runIntegrationTests { - trial --reporter=text $* test.integration + resolveNumOfCores + echo $NUM_OF_CORES + trial -j $NUM_OF_CORES --reporter=text $* test.integration } function runUnitTests { -- cgit v1.2.3