From ce5e82ba7d7235ff3dff8ceae880f16ec3d338a4 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Tue, 15 Mar 2016 15:12:17 -0500 Subject: [PATCH 1/5] Add a test runner script This script will do a clean and parallel build. If not on CircleCI, then parallelism is achieved by use of subshells. Otherwise the environment is expected to be providing container level parallelism. --- etc/bin/run-tests.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 etc/bin/run-tests.sh diff --git a/etc/bin/run-tests.sh b/etc/bin/run-tests.sh new file mode 100644 index 00000000..aa9de3de --- /dev/null +++ b/etc/bin/run-tests.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +function do_tests () { + case $CIRCLE_NODE_INDEX in + 0) + ant test-example 2>&1 | tee test-example.log + ;; + 1) + ant test-generative 2>&1 | tee test-generative.log + ;; + esac +} + +mvn clean compile # git info file, classfiles +bash etc/bin/antsetup.sh # set up standalone classpath + +if [ -n "$CIRCLE_NODE_INDEX" ] +then + do_tests +else + ( export CIRCLE_NODE_INDEX=0; + do_tests > /dev/null ) & + tex=$1 + ( export CIRCLE_NODE_INDEX=1; + do_tests > /dev/null ) & + teg=$1 + wait $tex + texr=$? + wait $teg + tegr=$? + if [ $texr ] && [ $tegr ] + then + echo "Tests OK!" + else + [ ! $texr ] && echo "Example tests failed, see test-example.log" + [ ! $tegr ] && echo "Generative tests failed, see test-generative.log" + echo "Tests failed :(" + exit 1 + fi +fi From 6a139128df2476bb906a8b48f6826b2f4776545c Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Tue, 15 Mar 2016 13:52:44 -0500 Subject: [PATCH 2/5] Fix self-referential circle-deps path --- etc/bin/circle-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/bin/circle-deps.sh b/etc/bin/circle-deps.sh index 7b58862a..18dd0af2 100644 --- a/etc/bin/circle-deps.sh +++ b/etc/bin/circle-deps.sh @@ -3,7 +3,7 @@ M2="$HOME/.m2" FLAGS="$M2/tags" mkdir -p "$FLAGS" -FILE="$FLAGS/$(cat pom.xml build.xml circle-deps.sh | grep -v ".*" | shasum -a 512 | awk '{print $1}')" +FILE="$FLAGS/$(cat pom.xml build.xml etc/bin/circle-deps.sh | grep -v ".*" | shasum -a 512 | awk '{print $1}')" if [ ! -e "$FILE" ] || (( RANDOM % 2 ==0 )) then # Do a deploy From bd904891b0c5c66e2c4ff8abec599e533f7bcf50 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Tue, 15 Mar 2016 14:08:50 -0500 Subject: [PATCH 3/5] Ensure that maven-classpath.properties goes to / --- etc/bin/antsetup.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/etc/bin/antsetup.sh b/etc/bin/antsetup.sh index 0cce8a92..b3da3be1 100755 --- a/etc/bin/antsetup.sh +++ b/etc/bin/antsetup.sh @@ -1,8 +1,9 @@ #!/bin/bash - -mvn -q dependency:build-classpath -Dmdep.outputFile=maven-classpath -cat <maven-classpath.properties -maven.compile.classpath=`cat maven-classpath` -maven.test.classpath=`cat maven-classpath` +ROOT=$(git rev-parse --show-toplevel) +mvn -q dependency:build-classpath -Dmdep.outputFile=$ROOT/maven-classpath +cat <$ROOT/maven-classpath.properties +maven.compile.classpath=`cat $ROOT/maven-classpath` +maven.test.classpath=`cat $ROOT/maven-classpath` EOF +rm $ROOT/maven-classpath echo "Wrote maven-classpath.properties for standalone ant use" From aad6d7dc5de03f9d4bbb5c1f2a69aaacd500bb5c Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Tue, 15 Mar 2016 13:31:22 -0500 Subject: [PATCH 4/5] Run test-example and test-generative in parallel Fixes #24 --- circle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/circle.yml b/circle.yml index 9747ae6c..9ccd2520 100644 --- a/circle.yml +++ b/circle.yml @@ -15,6 +15,9 @@ test: pre: - bash etc/bin/check-whitespace.sh - bash etc/bin/check-changelog.sh + override: + - bash etc/bin/run-tests.sh: + parallel: true post: - ant jar From a811775025caa6dc2a4fbaf0964bfe42e0f42d76 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Tue, 15 Mar 2016 13:33:14 -0500 Subject: [PATCH 5/5] Update CHANGELOG --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0fbb96a..fbeea75e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ ## Change Log ### upcoming +- [#105](https://github.com/jaunt-lang/jaunt/pull/105) Run CircleCI tests in parallel (@arrdem). + - Adds `etc/bin/run-tests.sh` + - If on CircleCI, tests will be run "normally" (CircleCI is configured to use two containers + when building Jaunt, choose which half of the test suite to run by the the + `$CIRCLE_NODE_INDEX` var.) + - If not on CircleCI, spawn a pair of subshells simulating CircleCI containers as above, check + their exit codes and report back. + - Configures CircleCI to use `run-tests.sh` - [#95](https://github.com/jaunt-lang/jaunt/pull/95) Introduce `*jaunt-version*`, deprecating `*clojure-version*` (@arrdem). - [#101](https://github.com/jaunt-lang/jaunt/pull/99) Add small (64px, 128px) logos (@arrdem). - [#99](https://github.com/jaunt-lang/jaunt/pull/99) Bugfix: make `private?` check `^:private` (@arrdem).