@@ -106,13 +106,19 @@ loop="${TIMES:-1}"
106
106
# hack/test-integration.sh WatchBuilds
107
107
# hack/test-integration.sh Template*
108
108
# hack/test-integration.sh "(WatchBuilds|Template)"
109
- tests=( $( go run " ${OS_ROOT} /hack/listtests.go" -prefix=" ${OS_GO_PACKAGE} /${package} .Test" " ${testexec} " | grep -E " ${1-Test} " ) )
109
+ listTemplate=' {{ range $i,$file := .TestGoFiles }}{{$.Dir}}/{{ $file }}{{ "\n" }}{{end}}'
110
+ tests=( $( go list -f " ${listTemplate} " " ./${package} " | xargs grep -E -o --no-filename ' ^func Test[^(]+' | cut -d ' ' -f 2 | grep -E " ${1-Test} " ) )
111
+
112
+ if [[ " ${# tests[@]} " == " 0" ]]; then
113
+ os::text::print_red " No tests found matching \" ${1-Test} \" "
114
+ exit 1
115
+ fi
110
116
111
117
# run each test as its own process
112
118
ret=0
113
119
test_result=" ok"
114
120
pushd " ${OS_ROOT} /${package} " & > /dev/null
115
- test_start_time=$( date +%s%3N )
121
+ test_start_time=$( date +%s)
116
122
for test in " ${tests[@]} " ; do
117
123
for(( i= 0 ;i< ${loop} ;i+= 1 )) ; do
118
124
if ! (exectest " ${test} " ${@: 2} ); then
@@ -121,10 +127,10 @@ for test in "${tests[@]}"; do
121
127
fi
122
128
done
123
129
done
124
- test_end_time=$( date +%s%3N )
130
+ test_end_time=$( date +%s)
125
131
test_duration=$(( test_end_time - test_start_time))
126
132
127
- echo " ${test_result} github.com/openshift/origin/test/integration $(( test_duration / 1000 )) .$(( test_duration % 1000 )) s " >> " ${JUNIT_REPORT_OUTPUT:-/ dev/ null} "
133
+ echo " ${test_result} github.com/openshift/origin/test/integration $(( test_duration)) .000s " >> " ${JUNIT_REPORT_OUTPUT:-/ dev/ null} "
128
134
129
135
popd & > /dev/null
130
136
0 commit comments