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:-opt} 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 41# The easiest way to copy all the reports files from inside of 42# the docker container is to zip them and then copy the zip. 43zip -r reports.zip reports 44find . -name report.xml -print0 | xargs -0 -r zip reports.zip 45find . -name sponge_log.xml -print0 | xargs -0 -r zip reports.zip 46find . -name 'report_*.xml' -print0 | xargs -0 -r zip reports.zip 47 48exit $exit_code 49