Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 1 | #!/bin/bash |
Jan Tattermusch | 788ee23 | 2016-01-26 12:19:44 -0800 | [diff] [blame] | 2 | # Copyright 2015-2016, Google Inc. |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 3 | # All rights reserved. |
| 4 | # |
| 5 | # Redistribution and use in source and binary forms, with or without |
| 6 | # modification, are permitted provided that the following conditions are |
| 7 | # met: |
| 8 | # |
| 9 | # * Redistributions of source code must retain the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer. |
| 11 | # * Redistributions in binary form must reproduce the above |
| 12 | # copyright notice, this list of conditions and the following disclaimer |
| 13 | # in the documentation and/or other materials provided with the |
| 14 | # distribution. |
| 15 | # * Neither the name of Google Inc. nor the names of its |
| 16 | # contributors may be used to endorse or promote products derived from |
| 17 | # this software without specific prior written permission. |
| 18 | # |
| 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | # |
Jan Tattermusch | 8266c67 | 2015-09-17 09:18:03 -0700 | [diff] [blame] | 31 | # This script is invoked by build_docker_and_run_tests.sh inside a docker |
Jan Tattermusch | c95eead | 2015-09-18 13:03:50 -0700 | [diff] [blame] | 32 | # container. You should never need to call this script on your own. |
Jan Tattermusch | 320bd61 | 2015-09-15 12:44:35 -0700 | [diff] [blame] | 33 | |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 34 | set -e |
| 35 | |
| 36 | export CONFIG=$config |
Craig Tiller | 1c8fc73 | 2016-03-24 00:30:24 -0700 | [diff] [blame] | 37 | export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 38 | |
Masood Malekghassemi | 60e5f91 | 2015-10-05 15:26:26 -0700 | [diff] [blame] | 39 | # Ensure that programs depending on current-user-ownership of cache directories |
| 40 | # are satisfied (it's being mounted from outside the image). |
Jan Tattermusch | 5ed5756 | 2016-02-07 17:54:46 -0800 | [diff] [blame] | 41 | chown $(whoami) $XDG_CACHE_HOME |
Masood Malekghassemi | 60e5f91 | 2015-10-05 15:26:26 -0700 | [diff] [blame] | 42 | |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 43 | mkdir -p /var/local/git |
| 44 | git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc |
| 45 | |
Nicolas "Pixel" Noble | 4d97707 | 2015-10-02 23:52:38 +0200 | [diff] [blame] | 46 | mkdir -p reports |
| 47 | |
Craig Tiller | d14d103 | 2016-02-24 15:39:55 -0800 | [diff] [blame] | 48 | $POST_GIT_STEP |
| 49 | |
Nicolas "Pixel" Noble | 61059d3 | 2015-12-02 01:45:45 +0100 | [diff] [blame] | 50 | exit_code=0 |
| 51 | |
| 52 | $RUN_TESTS_COMMAND || exit_code=$? |
Nicolas "Pixel" Noble | 4d97707 | 2015-10-02 23:52:38 +0200 | [diff] [blame] | 53 | |
| 54 | cd reports |
| 55 | echo '<html><head></head><body>' > index.html |
| 56 | find . -maxdepth 1 -mindepth 1 -type d | sort | while read d ; do |
| 57 | d=${d#*/} |
| 58 | n=${d//_/ } |
| 59 | echo "<a href='$d/index.html'>$n</a><br />" >> index.html |
| 60 | done |
| 61 | echo '</body></html>' >> index.html |
| 62 | cd .. |
| 63 | |
| 64 | zip -r reports.zip reports |
murgatroid99 | 85b9cd9 | 2016-02-24 13:18:47 -0800 | [diff] [blame] | 65 | find . -name report.xml | xargs zip reports.zip |
Nicolas "Pixel" Noble | 61059d3 | 2015-12-02 01:45:45 +0100 | [diff] [blame] | 66 | |
| 67 | exit $exit_code |