Explorar el Código

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
Logan Stucki hace 9 años
padre
commit
5c183328bb
Ninguna cuenta está vinculada al correo electrónico del colaborador
Se han modificado 3 ficheros con 9 adiciones y 7 borrados
  1. 4
    2
      .travis.yml
  2. 4
    4
      bin/journey-test.sh
  3. 1
    1
      bin/unit-tests.sh

+ 4
- 2
.travis.yml Ver fichero

2
 language: java
2
 language: java
3
 jdk:
3
 jdk:
4
   - oraclejdk8
4
   - oraclejdk8
5
+env:
6
+  - SCRIPT=bin/unit-tests.sh
7
+  - SCRIPT=bin/journey-test.sh
5
 
8
 
6
 # http://docs.travis-ci.com/user/migrating-from-legacy
9
 # http://docs.travis-ci.com/user/migrating-from-legacy
7
 sudo: false
10
 sudo: false
23
   - export PATH=$TRAVIS_BUILD_DIR/bin:$PATH  # ensure our tools are prefered over included ones.
26
   - export PATH=$TRAVIS_BUILD_DIR/bin:$PATH  # ensure our tools are prefered over included ones.
24
 
27
 
25
 script:
28
 script:
26
-  - bin/unit-tests.sh
27
-  - bin/journey-test.sh
29
+  - $SCRIPT
28
 
30
 
29
 # configure caching (https://docs.travis-ci.com/user/languages/java/#Caching)
31
 # configure caching (https://docs.travis-ci.com/user/languages/java/#Caching)
30
 before_cache:
32
 before_cache:

+ 4
- 4
bin/journey-test.sh Ver fichero

164
   cp -r ${track_root}/exercises tracks/${TRACK}
164
   cp -r ${track_root}/exercises tracks/${TRACK}
165
 
165
 
166
   gem install bundler
166
   gem install bundler
167
-  bundle install
167
+  bundle install -j4
168
   gem build trackler.gemspec
168
   gem build trackler.gemspec
169
 
169
 
170
   # Make *this* the gem that x-api uses when we build x-api.
170
   # Make *this* the gem that x-api uses when we build x-api.
181
   pushd $xapi_home
181
   pushd $xapi_home
182
 
182
 
183
   gem install bundler
183
   gem install bundler
184
-  bundle install
184
+  bundle install -j4
185
   RACK_ENV=development rackup &
185
   RACK_ENV=development rackup &
186
   xapi_pid=$!
186
   xapi_pid=$!
187
   sleep 5
187
   sleep 5
233
 
233
 
234
     pushd ${exercism_exercises_dir}/${TRACK}/${exercise}
234
     pushd ${exercism_exercises_dir}/${TRACK}/${exercise}
235
     # Check that tests compile before we strip @Ignore annotations
235
     # Check that tests compile before we strip @Ignore annotations
236
-    "$EXECPATH"/gradlew compileTestJava
236
+    "$EXECPATH"/gradlew compileTestJava --configure-on-demand --parallel
237
     # Ensure we run all the tests (as delivered, all but the first is @Ignore'd)
237
     # Ensure we run all the tests (as delivered, all but the first is @Ignore'd)
238
     for testfile in `find . -name "*Test.${TRACK_SRC_EXT}"`; do
238
     for testfile in `find . -name "*Test.${TRACK_SRC_EXT}"`; do
239
       # Strip @Ignore annotations to ensure we run the tests (as delivered, all but the first is @Ignore'd).
239
       # Strip @Ignore annotations to ensure we run the tests (as delivered, all but the first is @Ignore'd).
241
       # The stripping implementations here and in copyTestsFilteringIgnores should be kept consistent.
241
       # The stripping implementations here and in copyTestsFilteringIgnores should be kept consistent.
242
       sed 's/@Ignore\(\(.*\)\)\{0,1\}//' ${testfile} > "${tempfile}" && mv "${tempfile}" "${testfile}"
242
       sed 's/@Ignore\(\(.*\)\)\{0,1\}//' ${testfile} > "${tempfile}" && mv "${tempfile}" "${testfile}"
243
     done
243
     done
244
-    "$EXECPATH"/gradlew test
244
+    "$EXECPATH"/gradlew test --configure-on-demand --parallel
245
     popd
245
     popd
246
 
246
 
247
     current_exercise_number=$((current_exercise_number + 1))
247
     current_exercise_number=$((current_exercise_number + 1))

+ 1
- 1
bin/unit-tests.sh Ver fichero

10
 pushd exercises
10
 pushd exercises
11
 echo ""
11
 echo ""
12
 echo ">>> Running tests..."
12
 echo ">>> Running tests..."
13
-TERM=dumb ../gradlew check compileStarterSourceJava --parallel --continue
13
+TERM=dumb ../gradlew check compileStarterSourceJava --parallel --configure-on-demand --continue
14
 popd
14
 popd
15
 
15