Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 1 | #!/bin/bash |
Craig Tiller | 6169d5f | 2016-03-31 07:46:18 -0700 | [diff] [blame] | 2 | # Copyright 2015, 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 |
yang-g | 6ce4d0b | 2016-05-12 16:43:17 -0700 | [diff] [blame] | 38 | export PATH=$PATH:/usr/bin/llvm-symbolizer |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 39 | |
Masood Malekghassemi | 60e5f91 | 2015-10-05 15:26:26 -0700 | [diff] [blame] | 40 | # Ensure that programs depending on current-user-ownership of cache directories |
| 41 | # are satisfied (it's being mounted from outside the image). |
Jan Tattermusch | 5ed5756 | 2016-02-07 17:54:46 -0800 | [diff] [blame] | 42 | chown $(whoami) $XDG_CACHE_HOME |
Masood Malekghassemi | 60e5f91 | 2015-10-05 15:26:26 -0700 | [diff] [blame] | 43 | |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 44 | mkdir -p /var/local/git |
Matt Kwong | 66a1eea | 2016-09-29 18:30:19 -0700 | [diff] [blame] | 45 | git clone /var/local/jenkins/grpc /var/local/git/grpc |
| 46 | # clone gRPC submodules, use data from locally cloned submodules where possible |
| 47 | (cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ |
| 48 | && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ |
| 49 | ${name}') |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 50 | |
Nicolas "Pixel" Noble | 4d97707 | 2015-10-02 23:52:38 +0200 | [diff] [blame] | 51 | mkdir -p reports |
| 52 | |
Craig Tiller | d14d103 | 2016-02-24 15:39:55 -0800 | [diff] [blame] | 53 | $POST_GIT_STEP |
| 54 | |
Nicolas "Pixel" Noble | 61059d3 | 2015-12-02 01:45:45 +0100 | [diff] [blame] | 55 | exit_code=0 |
| 56 | |
| 57 | $RUN_TESTS_COMMAND || exit_code=$? |
Nicolas "Pixel" Noble | 4d97707 | 2015-10-02 23:52:38 +0200 | [diff] [blame] | 58 | |
| 59 | cd reports |
| 60 | echo '<html><head></head><body>' > index.html |
| 61 | find . -maxdepth 1 -mindepth 1 -type d | sort | while read d ; do |
| 62 | d=${d#*/} |
| 63 | n=${d//_/ } |
| 64 | echo "<a href='$d/index.html'>$n</a><br />" >> index.html |
| 65 | done |
| 66 | echo '</body></html>' >> index.html |
| 67 | cd .. |
| 68 | |
| 69 | zip -r reports.zip reports |
Jan Tattermusch | ba5196a | 2016-09-19 18:20:37 +0200 | [diff] [blame] | 70 | find . -name report.xml | xargs -r zip reports.zip |
| 71 | find . -name 'report_*.xml' | xargs -r zip reports.zip |
Nicolas "Pixel" Noble | 61059d3 | 2015-12-02 01:45:45 +0100 | [diff] [blame] | 72 | |
| 73 | exit $exit_code |