summaryrefslogtreecommitdiff
path: root/service/go
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2015-02-03 12:36:10 -0200
committerDuda Dornelles <ddornell@thoughtworks.com>2015-02-03 12:36:18 -0200
commitb2692d94b3968ca82720841a61d4d31e7e253da9 (patch)
treed2b209c5e8827be27339bd6ca472444c96805c60 /service/go
parente4c47334a5b986397e93a88badc263648d7d2ae0 (diff)
Auto-detecting the number of cores to run integration tests in parallel
Diffstat (limited to 'service/go')
-rwxr-xr-xservice/go14
1 files changed, 13 insertions, 1 deletions
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 {