• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright 2015 gRPC authors.
3#
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
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
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.
15#
16# This script is invoked by build_docker_and_run_tests.sh inside a docker
17# container. You should never need to call this script on your own.
18
19set -e
20
21export CONFIG=$config
22export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
23export PATH=$PATH:/usr/bin/llvm-symbolizer
24
25mkdir -p /var/local/git
26git clone /var/local/jenkins/grpc /var/local/git/grpc
27# clone gRPC submodules, use data from locally cloned submodules where possible
28# TODO: figure out a way to eliminate this shellcheck suppression:
29# shellcheck disable=SC2016
30(cd /var/local/jenkins/grpc/ && git submodule foreach 'git clone /var/local/jenkins/grpc/${name} /var/local/git/grpc/${name}')
31(cd /var/local/git/grpc/ && git submodule init)
32
33mkdir -p reports
34
35$POST_GIT_STEP
36
37exit_code=0
38
39$RUN_TESTS_COMMAND || exit_code=$?
40
41cd reports
42echo '<html><head></head><body>' > index.html
43find . -maxdepth 1 -mindepth 1 -type d | sort | while read d ; do
44  d=${d#*/}
45  n=${d//_/ }
46  echo "<a href='$d/index.html'>$n</a><br />" >> index.html
47done
48echo '</body></html>' >> index.html
49cd ..
50
51zip -r reports.zip reports
52find . -name report.xml -print0 | xargs -0 -r zip reports.zip
53find . -name sponge_log.xml -print0 | xargs -0 -r zip reports.zip
54find . -name 'report_*.xml' -print0 | xargs -0 -r zip reports.zip
55
56exit $exit_code
57