#! /bin/bash # # Given a bucket containing coverage.py data, this script retrieves and combines # that coverage data, generates an HTML report, and pushes the results back to # the bucket. A textual report is also printed for convenience when looking at # the CI. # # This script assumes that the provided bucket has a folder inside it with a # name corresponding to the current gpdb_src commit SHA. # set -ex if [ $# -ne 2 ]; then echo "Usage: $0 COVERAGE_BUCKET_URI COVERAGE_BUCKET_PATH" exit 1 fi # Trim any trailing slash from the bucket uri. BUCKET_URI="${1%/}" BUCKET_PATH=$2 CWD=$(pwd) read -r COMMIT_SHA < gpdb_src/.git/HEAD # Coverage.py needs to be able to find the source files that were used during # the coverage run. The easiest way to do that for the majority of those files # is to install GPDB in the same place it was installed on the clusters. source ./gpdb_src/concourse/scripts/common.bash time install_gpdb # Set PIP Download cache directory export PIP_CACHE_DIR=${PWD}/pip-cache-dir pip --retries 10 install -r ./gpdb_src/gpMgmt/requirements-dev.txt # Save the JSON_KEY to a file, for later use by gsutil. keyfile=secret-key.json saved_umask=$(umask) umask 077 cat - <<< "$JSON_KEY" > "$keyfile" umask "${saved_umask}" # Generate a Boto configuration file for gsutil. cat - > boto.cfg < .coveragerc <