Skip to content

Commit 45c6ac1

Browse files
authored
Merge pull request #3842 from senivam/travisParallelProfile
Travis CI parallel script and code style fix A little improvement in Travis CI build script - running 2 profiles in parallel (takes about 25 minutes each) thus the whole build takes about 25 minutes (per longer profile build)
2 parents 8a7d7ff + 47952cf commit 45c6ac1

File tree

3 files changed

+43
-7
lines changed

3 files changed

+43
-7
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1+
sudo: required
2+
13
language: java
24

5+
services:
6+
- docker
7+
38
jdk:
49
- oraclejdk8
510

611
cache:
712
directories:
813
- .autoconf
14+
env:
15+
matrix:
16+
- TEST_SET="-Ptravis_e2e_skip"
17+
- TEST_SET="-Ptravis_e2e"
918

1019
install: true
1120

1221
script:
13-
- bash travis.sh
22+
- bash travis.sh $TEST_SET

tests/e2e-entity/src/test/java/org/glassfish/jersey/tests/e2e/json/JaxbTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private static boolean isJavaVersionSupported() {
108108
if (javaVersion != null) {
109109
int pos = javaVersion.lastIndexOf("_");
110110
if (pos > -1) {
111-
final Integer minorVersion = Integer.valueOf(javaVersion.substring(pos+1));
111+
final Integer minorVersion = Integer.valueOf(javaVersion.substring(pos + 1));
112112
return minorVersion < 160 || minorVersion > 172; //only those between 161 and 172 minor
113113
// releases are not supported
114114
}

travis.sh

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
11
#!/bin/bash
2+
# Abort on Error
3+
set -e
24

3-
mvn -e -U -B clean install -Ptravis_e2e_skip 2>&1 | tee jersey-build.log | grep -E '(---)|(Building)|(Tests run)|(T E S T S)'
4-
echo '------------------------------------------------------------------------'
5-
tail -100 jersey-build.log
6-
cd tests
7-
mvn -e -B test -Ptravis_e2e
5+
export PING_SLEEP=30s
6+
export WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
7+
export BUILD_OUTPUT=$WORKDIR/build.out
8+
9+
touch $BUILD_OUTPUT
10+
11+
dump_output() {
12+
echo Tailing the last 500 lines of output:
13+
tail -500 $BUILD_OUTPUT
14+
}
15+
error_handler() {
16+
echo ERROR: An error was encountered with the build.
17+
dump_output
18+
exit 1
19+
}
20+
# If an error occurs, run our error handler to output a tail of the build
21+
trap 'error_handler' ERR
22+
23+
# Set up a repeating loop to send some output to Travis.
24+
25+
bash -c "while true; do tail -5 $BUILD_OUTPUT; sleep $PING_SLEEP; done" &
26+
PING_LOOP_PID=$!
27+
28+
mvn -e -U -B clean install $1 >> $BUILD_OUTPUT 2>&1
29+
30+
# The build finished without returning an error so dump a tail of the output
31+
dump_output
32+
33+
# nicely terminate the ping output loop
34+
kill $PING_LOOP_PID

0 commit comments

Comments
 (0)