diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2016-10-15 13:45:31 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2016-10-25 15:12:40 +0000 |
commit | 669783b5d394dcfddabc0dcc2e42616aad2e6123 (patch) | |
tree | 1422dbc5d77667cdb83c76a7258d21541cf49ef9 /jenkins.sh | |
parent | 451c95a49f59d3a1798dc5bbffefdbe05ac9c42b (diff) |
jenkins.sh: Split build and test into 2 abe.sh invocations
The purpose is two-fold. Firstly, this patch is a step towards
separating build and test stages, which we need for testing of
binary releases.
Immediatelly, however, this patch makes --testcontainerfile
jenkins.sh option possible. By splitting test from the build
we give time for $testcontainerfile to appear once the test container
is started.
Change-Id: Ie85fffa8f46498f08fc2eb2fcdd5733586826a1e
Diffstat (limited to 'jenkins.sh')
-rwxr-xr-x | jenkins.sh | 53 |
1 files changed, 32 insertions, 21 deletions
@@ -242,25 +242,6 @@ if test x"${linux_snapshot}" != x"latest" -a x"${linux_snapshot}" != x; then change="${change} linux-${linux_snapshot}" fi -# if runtests is true, then run make check after the build completes -if test x"${runtests}" = xtrue; then - # check that expect is working, and dump some debug info then exit if not - if ! echo "spawn true" | /usr/bin/expect -f - >/dev/null; then - echo "expect cannot spawn processes. Aborting make check." - echo "some debug info follows..." - echo "running: ls -l /dev/ptmx" - ls -l /dev/ptmx - echo "running: ls -l /dev/pts" - ls -l /dev/pts - echo "running: grep devpts /proc/mounts" - grep devpts /proc/mounts - exit 1 - fi - - check="--check all" - check="${check}${excludecheck_opt}" -fi - if test x"${target}" != x"native" -a x"${target}" != x; then platform="--target ${target}" fi @@ -355,7 +336,7 @@ fi # Now we build the cross compiler, for a native compiler this becomes # the stage2 bootstrap build. ret=0 -$CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${check} ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > build.out 2> >(tee build.err >&2) || ret=$? +$CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > build.out 2> >(tee build.err >&2) || ret=$? # If abe returned an error, make jenkins see this as a build failure if test $ret -gt 0; then @@ -365,6 +346,36 @@ if test $ret -gt 0; then exit 1 fi +# if runtests is true, then run make check after the build completes +if test x"${runtests}" = xtrue; then + # check that expect is working, and dump some debug info then exit if not + if ! echo "spawn true" | /usr/bin/expect -f - >/dev/null; then + echo "expect cannot spawn processes. Aborting make check." + echo "some debug info follows..." + echo "running: ls -l /dev/ptmx" + ls -l /dev/ptmx + echo "running: ls -l /dev/pts" + ls -l /dev/pts + echo "running: grep devpts /proc/mounts" + grep devpts /proc/mounts + exit 1 + fi + + check="--check all" + check="${check}${excludecheck_opt}" + + ret=0 + $CONFIG_SHELL ${abe_dir}/abe.sh --disable update ${check} ${tars} ${releasestr} ${platform} ${change} ${try_bootstrap} --timeout 100 --build all --disable make_docs > check.out 2> >(tee check.err >&2) || ret=$? + + # If abe returned an error, make jenkins see this as a build failure + if test $ret -gt 0; then + echo "================= TAIL OF LOG: BEGIN =================" + tail -n 50 check.out + echo "================= TAIL OF LOG: FINISH =================" + exit 1 + fi +fi + # Create the BUILD-INFO file for Jenkins. cat << EOF > ${user_workspace}/BUILD-INFO.txt Format-Version: 0.5 @@ -480,7 +491,7 @@ if test x"${logserver}" != x"" && test x"${sums}" != x -o x"${runtests}" != x"tr cp ${logs} ${logs_dir}/ || status=1 # Copy stdout and stderr output from abe. - cp build.out build.err ${logs_dir}/ || status=1 + cp build.out build.err check.out check.err ${logs_dir}/ || status=1 xz ${logs_dir}/* || status=1 scp ${logs_dir}/* ${logserver}:${basedir}/${dir}/ || status=1 |