bin/coverage
#!/usr/bin/env bash
set -eox pipefail
junit_output_file="./junit.output"
. bin/build_utils
function main() {
build_docker_junit_image
run_junit_report
}
function build_docker_junit_image() {
rm -f junit.xml
echo "Building junit image..."
docker build -f Dockerfile.junit -t secrets-provider-for-k8s-junit:latest .
}
function run_junit_report() {
echo "Creating junit report and coverage output XML"
docker run --rm \
-v $PWD/:/test \
secrets-provider-for-k8s-junit:latest \
bash -exc "
cat ./junit.output | go-junit-report > ./junit.xml ;
gocov convert ./c.out | gocov-xml > ./coverage.xml
"
}
main