forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bazel-test.sh
executable file
·31 lines (25 loc) · 892 Bytes
/
bazel-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
set -e
source hack/common.sh
source hack/bootstrap.sh
source hack/config.sh
rm -rf ${ARTIFACTS}/junit ${ARTIFACTS}/testlogs
if [ "${CI}" == "true" ]; then
cat >>ci.bazelrc <<EOF
test --cache_test_results=no --runs_per_test=1
EOF
function collect_results() {
cd ${KUBEVIRT_DIR}
mkdir -p ${ARTIFACTS}/junit/
bazel run //tools/junit-merger:junit-merger -- -o ${ARTIFACTS}/junit/junit.unittests.xml $(find bazel-testlogs/ -name 'test.xml' -printf "%p ")
for f in $(find bazel-out/ -name 'test.log'); do
dir=${ARTIFACTS}/testlogs/$(dirname $f)
mkdir -p ${dir}
cp -f ${f} ${dir}/test.log
done
}
trap collect_results EXIT
fi
bazel test \
--config=${ARCHITECTURE} \
--features race \
--test_output=errors -- //staging/src/kubevirt.io/client-go/... //pkg/... //cmd/... //tests/framework/...