22
33set -e
44
5+ folder=/test/unit
6+
57cd /build && \
6- mkdir -p /test/unit && \
8+ mkdir -p $folder && \
79go run ./testData/downloadModels.go
810
9- echo HUGOT_BUILD_TAG is " $HUGOT_BUILD_TAG "
11+ echo " Running ORT tests..."
12+
13+ gotestsum --format testname --junitfile=$folder /unit-onnx.xml --jsonfile=$folder /unit-onnx.json -- -coverprofile=$folder /cover-ort.out -coverpkg ./... -tags=ORT -timeout 60m -race
14+
15+ echo " ORT tests completed."
16+
17+ echo " Running XLA tests..."
18+
19+ gotestsum --format testname --junitfile=$folder /unit-xla.xml --jsonfile=$folder /unit-xla.json -- -coverprofile=$folder /cover-xla.out -coverpkg ./... -tags=XLA -timeout 60m -race
20+
21+ echo " XLA tests completed."
22+
23+ echo " Running training tests..."
24+
25+ gotestsum --format testname --junitfile=$folder /unit-training.xml --jsonfile=$folder /unit-training.json -- -coverprofile=$folder /cover-training.out -coverpkg ./... -tags=ORT,XLA,TRAINING -timeout 60m -race
26+
27+ echo " Training tests completed."
28+
29+ # echo "Running simplego tests..."
30+
31+ # gotestsum --format testname --junitfile=$folder/unit-go.xml --jsonfile=$folder/unit-go.json -- -tags=GO -timeout 60m
32+
33+ # echo "simplego tests completed."
1034
11- if [[ -n $HUGOT_BUILD_TAG ]] ; then
12- echo " running with -tags=ALL "
13- gotestsum --junitfile=/test/unit/unit.xml --jsonfile=/test/unit/unit.json -- -tags=ALL -coverprofile=/test/unit/ cover.out.pre -coverpkg ./... -timeout 60m -race -covermode=atomic ./...
14- else
15- echo " running without build tags "
16- gotestsum --junitfile=/test/unit/unit.xml --jsonfile=/test/unit/unit.json -- -coverprofile=/test/unit/ cover.out.pre ./... -timeout 60m -race -covermode=atomic ./...
17- fi
35+ Merge coverage files manually
36+ echo " merging coverage "
37+ head -n 1 $folder / cover-ort .out > $folder /cover.out
38+ tail -n +2 $folder /cover-ort.out >> $folder /cover.out
39+ tail -n +2 $folder /cover-xla.out >> $folder /cover.out
40+ tail -n +2 $folder / cover-training .out >> $folder /cover.out
41+ # tail -n +2 $folder/cover-go.out >> $folder/cover.out
1842
19- grep -v " downloadModels.go" /test/unit/cover.out.pre > /test/unit/cover.out && rm /test/unit/cover.out.pre
43+ # # Optionally, remove downloadModels.go lines
44+ grep -v " downloadModels.go" $folder /cover.out > $folder /cover.final.out
2045
21- echo Done.
46+ echo Done.
0 commit comments