Skip to content

Commit 5c18332

Browse files
committed
Attempt to optimize build
Run unit test and journey test on seperate nodes Gradle uses --configure-on-demand and --parallel where it wasn't present Bundle install uses -j4
1 parent a3136ec commit 5c18332

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
language: java
33
jdk:
44
- oraclejdk8
5+
env:
6+
- SCRIPT=bin/unit-tests.sh
7+
- SCRIPT=bin/journey-test.sh
58

69
# http://docs.travis-ci.com/user/migrating-from-legacy
710
sudo: false
@@ -23,8 +26,7 @@ before_script:
2326
- export PATH=$TRAVIS_BUILD_DIR/bin:$PATH # ensure our tools are prefered over included ones.
2427

2528
script:
26-
- bin/unit-tests.sh
27-
- bin/journey-test.sh
29+
- $SCRIPT
2830

2931
# configure caching (https://docs.travis-ci.com/user/languages/java/#Caching)
3032
before_cache:

bin/journey-test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ make_local_trackler() {
164164
cp -r ${track_root}/exercises tracks/${TRACK}
165165

166166
gem install bundler
167-
bundle install
167+
bundle install -j4
168168
gem build trackler.gemspec
169169

170170
# Make *this* the gem that x-api uses when we build x-api.
@@ -181,7 +181,7 @@ start_x_api() {
181181
pushd $xapi_home
182182

183183
gem install bundler
184-
bundle install
184+
bundle install -j4
185185
RACK_ENV=development rackup &
186186
xapi_pid=$!
187187
sleep 5
@@ -233,15 +233,15 @@ solve_all_exercises() {
233233

234234
pushd ${exercism_exercises_dir}/${TRACK}/${exercise}
235235
# Check that tests compile before we strip @Ignore annotations
236-
"$EXECPATH"/gradlew compileTestJava
236+
"$EXECPATH"/gradlew compileTestJava --configure-on-demand --parallel
237237
# Ensure we run all the tests (as delivered, all but the first is @Ignore'd)
238238
for testfile in `find . -name "*Test.${TRACK_SRC_EXT}"`; do
239239
# Strip @Ignore annotations to ensure we run the tests (as delivered, all but the first is @Ignore'd).
240240
# Note that unit-test.sh also strips @Ignore annotations via the Gradle task copyTestsFilteringIgnores.
241241
# The stripping implementations here and in copyTestsFilteringIgnores should be kept consistent.
242242
sed 's/@Ignore\(\(.*\)\)\{0,1\}//' ${testfile} > "${tempfile}" && mv "${tempfile}" "${testfile}"
243243
done
244-
"$EXECPATH"/gradlew test
244+
"$EXECPATH"/gradlew test --configure-on-demand --parallel
245245
popd
246246

247247
current_exercise_number=$((current_exercise_number + 1))

bin/unit-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ bin/configlet .
1010
pushd exercises
1111
echo ""
1212
echo ">>> Running tests..."
13-
TERM=dumb ../gradlew check compileStarterSourceJava --parallel --continue
13+
TERM=dumb ../gradlew check compileStarterSourceJava --parallel --configure-on-demand --continue
1414
popd
1515

0 commit comments

Comments
 (0)