blob: 90a2bd8e36201044bed130e0ebd970bd2075c78d [file] [log] [blame]
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +02001#!/bin/bash
Jan Tattermusch788ee232016-01-26 12:19:44 -08002# Copyright 2015-2016, 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
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020038
Masood Malekghassemi60e5f912015-10-05 15:26:26 -070039# Ensure that programs depending on current-user-ownership of cache directories
40# are satisfied (it's being mounted from outside the image).
Jan Tattermusch5ed57562016-02-07 17:54:46 -080041chown $(whoami) $XDG_CACHE_HOME
Masood Malekghassemi60e5f912015-10-05 15:26:26 -070042
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020043mkdir -p /var/local/git
44git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
45
Nicolas "Pixel" Noble4d977072015-10-02 23:52:38 +020046mkdir -p reports
47
Craig Tillerd14d1032016-02-24 15:39:55 -080048$POST_GIT_STEP
49
Nicolas "Pixel" Noble61059d32015-12-02 01:45:45 +010050exit_code=0
51
52$RUN_TESTS_COMMAND || exit_code=$?
Nicolas "Pixel" Noble4d977072015-10-02 23:52:38 +020053
54cd reports
55echo '<html><head></head><body>' > index.html
56find . -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
60done
61echo '</body></html>' >> index.html
62cd ..
63
64zip -r reports.zip reports
murgatroid9985b9cd92016-02-24 13:18:47 -080065find . -name report.xml | xargs zip reports.zip
Nicolas "Pixel" Noble61059d32015-12-02 01:45:45 +010066
67exit $exit_code