blob: eb220ae416fea16d82a26ffcba5c3e38cc9c21fd [file] [log] [blame]
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +02001#!/bin/bash
Craig Tiller6169d5f2016-03-31 07:46:18 -07002# Copyright 2015, Google Inc.
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +02003# 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 Tattermusch8266c672015-09-17 09:18:03 -070031# This script is invoked by build_docker_and_run_tests.sh inside a docker
Jan Tattermuschc95eead2015-09-18 13:03:50 -070032# container. You should never need to call this script on your own.
Jan Tattermusch320bd612015-09-15 12:44:35 -070033
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020034set -e
35
36export CONFIG=$config
Craig Tiller1c8fc732016-03-24 00:30:24 -070037export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
yang-g6ce4d0b2016-05-12 16:43:17 -070038export PATH=$PATH:/usr/bin/llvm-symbolizer
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020039
Masood Malekghassemi60e5f912015-10-05 15:26:26 -070040# Ensure that programs depending on current-user-ownership of cache directories
41# are satisfied (it's being mounted from outside the image).
Jan Tattermusch5ed57562016-02-07 17:54:46 -080042chown $(whoami) $XDG_CACHE_HOME
Masood Malekghassemi60e5f912015-10-05 15:26:26 -070043
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020044mkdir -p /var/local/git
Matt Kwong66a1eea2016-09-29 18:30:19 -070045git 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" Noble964f9552015-06-25 02:01:27 +020050
Nicolas "Pixel" Noble4d977072015-10-02 23:52:38 +020051mkdir -p reports
52
Craig Tillerd14d1032016-02-24 15:39:55 -080053$POST_GIT_STEP
54
Nicolas "Pixel" Noble61059d32015-12-02 01:45:45 +010055exit_code=0
56
57$RUN_TESTS_COMMAND || exit_code=$?
Nicolas "Pixel" Noble4d977072015-10-02 23:52:38 +020058
59cd reports
60echo '<html><head></head><body>' > index.html
61find . -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
65done
66echo '</body></html>' >> index.html
67cd ..
68
69zip -r reports.zip reports
Jan Tattermuschba5196a2016-09-19 18:20:37 +020070find . -name report.xml | xargs -r zip reports.zip
71find . -name 'report_*.xml' | xargs -r zip reports.zip
Nicolas "Pixel" Noble61059d32015-12-02 01:45:45 +010072
73exit $exit_code