...

Text file src/edge-infra.dev/hack/scripts/ci/ci-unit-test-targets-file.sh

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

     1#!/usr/bin/env bash
     2usage() { echo "Usage: $0 [-c <bazelrc config>] [-f use file output]" 1>&2; exit 0; }
     3[ $# -eq 0 ] && usage
     4while getopts ":f:c:h" opt; do
     5    case $opt in 
     6        f) targets_file="$OPTARG" ;;
     7        c) config="--config=$OPTARG" ;;
     8        h | *) usage ;;
     9    esac
    10done
    11
    12echo "Testing targets:"
    13
    14bazel test "$config" --target_pattern_file="$targets_file" --test_tag_filters=-integration,-end-to-end
    15test_exit=$?
    16
    17# Ok to exit 0 if bazel test exit is 4 (test requsted but none to run)
    18if [[ $test_exit == 4 ]]; then
    19    echo "No tests to run"
    20    exit 0;
    21fi
    22
    23exit $test_exit

View as plain text