...

Text file src/edge-infra.dev/hack/build/ci/collect-bazel-test-reports.sh

Documentation: edge-infra.dev/hack/build/ci

     1#!/usr/bin/env bash
     2
     3set -euo pipefail
     4
     5echo "report dir: ${1}"
     6
     7dir="${1:-"tmp/junit"}"
     8
     9echo "collecting junit reports to $dir"
    10echo "cleaning $dir"
    11rm -rf "$dir"
    12echo "creating $dir"
    13mkdir -p "$dir"
    14
    15files=()
    16while IFS='' read -r line; do files+=("$line"); done < <(find -L "$(bazel info bazel-testlogs)" -name 'test.xml')
    17
    18for FILE in "${files[@]}"
    19do
    20  new="$dir/$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c10).xml"
    21  echo "copying $FILE to $new"
    22  cp "$FILE" "$new"
    23done
    24
    25echo "done"

View as plain text