Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 1 | #!/bin/bash |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 2 | # Copyright 2015 gRPC authors. |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 3 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 7 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 9 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 15 | # |
Jan Tattermusch | 8266c67 | 2015-09-17 09:18:03 -0700 | [diff] [blame] | 16 | # 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] | 17 | # container. You should never need to call this script on your own. |
Jan Tattermusch | 320bd61 | 2015-09-15 12:44:35 -0700 | [diff] [blame] | 18 | |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 19 | set -e |
| 20 | |
| 21 | export CONFIG=$config |
Craig Tiller | 1c8fc73 | 2016-03-24 00:30:24 -0700 | [diff] [blame] | 22 | export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer |
yang-g | 6ce4d0b | 2016-05-12 16:43:17 -0700 | [diff] [blame] | 23 | export PATH=$PATH:/usr/bin/llvm-symbolizer |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 24 | |
Masood Malekghassemi | 60e5f91 | 2015-10-05 15:26:26 -0700 | [diff] [blame] | 25 | # Ensure that programs depending on current-user-ownership of cache directories |
| 26 | # are satisfied (it's being mounted from outside the image). |
Jan Tattermusch | 5ed5756 | 2016-02-07 17:54:46 -0800 | [diff] [blame] | 27 | chown $(whoami) $XDG_CACHE_HOME |
Masood Malekghassemi | 60e5f91 | 2015-10-05 15:26:26 -0700 | [diff] [blame] | 28 | |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 29 | mkdir -p /var/local/git |
Matt Kwong | 66a1eea | 2016-09-29 18:30:19 -0700 | [diff] [blame] | 30 | git clone /var/local/jenkins/grpc /var/local/git/grpc |
| 31 | # clone gRPC submodules, use data from locally cloned submodules where possible |
| 32 | (cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ |
| 33 | && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ |
| 34 | ${name}') |
Nicolas "Pixel" Noble | 964f955 | 2015-06-25 02:01:27 +0200 | [diff] [blame] | 35 | |
Nicolas "Pixel" Noble | 4d97707 | 2015-10-02 23:52:38 +0200 | [diff] [blame] | 36 | mkdir -p reports |
| 37 | |
Craig Tiller | d14d103 | 2016-02-24 15:39:55 -0800 | [diff] [blame] | 38 | $POST_GIT_STEP |
| 39 | |
Nicolas "Pixel" Noble | 61059d3 | 2015-12-02 01:45:45 +0100 | [diff] [blame] | 40 | exit_code=0 |
| 41 | |
| 42 | $RUN_TESTS_COMMAND || exit_code=$? |
Nicolas "Pixel" Noble | 4d97707 | 2015-10-02 23:52:38 +0200 | [diff] [blame] | 43 | |
| 44 | cd reports |
| 45 | echo '<html><head></head><body>' > index.html |
| 46 | find . -maxdepth 1 -mindepth 1 -type d | sort | while read d ; do |
| 47 | d=${d#*/} |
| 48 | n=${d//_/ } |
| 49 | echo "<a href='$d/index.html'>$n</a><br />" >> index.html |
| 50 | done |
| 51 | echo '</body></html>' >> index.html |
| 52 | cd .. |
| 53 | |
| 54 | zip -r reports.zip reports |
Jan Tattermusch | ba5196a | 2016-09-19 18:20:37 +0200 | [diff] [blame] | 55 | find . -name report.xml | xargs -r zip reports.zip |
Jan Tattermusch | 1642b7c | 2017-02-24 00:45:21 +0100 | [diff] [blame] | 56 | find . -name sponge_log.xml | xargs -r zip reports.zip |
Jan Tattermusch | ba5196a | 2016-09-19 18:20:37 +0200 | [diff] [blame] | 57 | find . -name 'report_*.xml' | xargs -r zip reports.zip |
Nicolas "Pixel" Noble | 61059d3 | 2015-12-02 01:45:45 +0100 | [diff] [blame] | 58 | |
| 59 | exit $exit_code |