Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Tests in Parallel #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/ \;
Expand Down
9 changes: 9 additions & 0 deletions runTestParallel.sh
Original file line number Diff line number Diff line change
@@ -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