diff --git a/circle.yml b/circle.yml index 74d9e38..8da5a7a 100644 --- a/circle.yml +++ b/circle.yml @@ -16,6 +16,9 @@ general: - "build/reports/tests" # preserve the generated HTML test reports test: + override: + - sh ./runTestParallel.sh: + parallel: true post: - mkdir -p $CIRCLE_TEST_REPORTS/junit/ - find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \; diff --git a/runTestParallel.sh b/runTestParallel.sh new file mode 100755 index 0000000..a69c9ff --- /dev/null +++ b/runTestParallel.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "Total No.of nodes... ${CIRCLE_NODE_TOTAL}" +echo "Current node index....${CIRCLE_NODE_INDEX}" + +testFiles=$(find src/test/groovy/org/gosulang/gradle -name '*.groovy' | +sort | awk "NR % ${CIRCLE_NODE_TOTAL} == ${CIRCLE_NODE_INDEX}"|awk -F "/groovy/" '{print $2}'|awk -F "." '{print "--tests "$1}'|tr '/' '.') +echo $testFiles +./gradlew test $testFiles