blob: 15d703962c849323aa7982aeb333cb286a1c4b88 [file] [log] [blame]
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +02001#!/bin/bash
Jan Tattermusch7897ae92017-06-07 22:57:36 +02002# Copyright 2015 gRPC authors.
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +02003#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02004# 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" Noble964f9552015-06-25 02:01:27 +02007#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02008# http://www.apache.org/licenses/LICENSE-2.0
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +02009#
Jan Tattermusch7897ae92017-06-07 22:57:36 +020010# 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" Noble964f9552015-06-25 02:01:27 +020015#
Jan Tattermusch8266c672015-09-17 09:18:03 -070016# This script is invoked by build_docker_and_run_tests.sh inside a docker
Jan Tattermuschc95eead2015-09-18 13:03:50 -070017# container. You should never need to call this script on your own.
Jan Tattermusch320bd612015-09-15 12:44:35 -070018
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020019set -e
20
21export CONFIG=$config
Craig Tiller1c8fc732016-03-24 00:30:24 -070022export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
yang-g6ce4d0b2016-05-12 16:43:17 -070023export PATH=$PATH:/usr/bin/llvm-symbolizer
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020024
Masood Malekghassemi60e5f912015-10-05 15:26:26 -070025# Ensure that programs depending on current-user-ownership of cache directories
26# are satisfied (it's being mounted from outside the image).
Jan Tattermusch5ed57562016-02-07 17:54:46 -080027chown $(whoami) $XDG_CACHE_HOME
Masood Malekghassemi60e5f912015-10-05 15:26:26 -070028
Nicolas "Pixel" Noble964f9552015-06-25 02:01:27 +020029mkdir -p /var/local/git
Matt Kwong66a1eea2016-09-29 18:30:19 -070030git 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" Noble964f9552015-06-25 02:01:27 +020035
Nicolas "Pixel" Noble4d977072015-10-02 23:52:38 +020036mkdir -p reports
37
Craig Tillerd14d1032016-02-24 15:39:55 -080038$POST_GIT_STEP
39
Nicolas "Pixel" Noble61059d32015-12-02 01:45:45 +010040exit_code=0
41
42$RUN_TESTS_COMMAND || exit_code=$?
Nicolas "Pixel" Noble4d977072015-10-02 23:52:38 +020043
44cd reports
45echo '<html><head></head><body>' > index.html
46find . -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
50done
51echo '</body></html>' >> index.html
52cd ..
53
54zip -r reports.zip reports
Jan Tattermuschba5196a2016-09-19 18:20:37 +020055find . -name report.xml | xargs -r zip reports.zip
Jan Tattermusch1642b7c2017-02-24 00:45:21 +010056find . -name sponge_log.xml | xargs -r zip reports.zip
Jan Tattermuschba5196a2016-09-19 18:20:37 +020057find . -name 'report_*.xml' | xargs -r zip reports.zip
Nicolas "Pixel" Noble61059d32015-12-02 01:45:45 +010058
59exit $exit_code