File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
# service files
4
- update_services =` git diff --name-status origin/master| awk ' {print $2}' | grep " ^tencentcloud/" | xargs egrep " type .+Service struct " | awk ' {print $2}' `
4
+ update_service_functions =` git diff --name-status origin/master| awk ' {print $2}' | grep " ^tencentcloud/service* " | xargs git diff | grep " @@ " | grep " func " | awk -F " ) " ' {print $2}' | awk -F " ( " ' {print $1} ' | tr -d ' ' `
5
5
need_test_files=" "
6
- for update_service in $update_services ; do
7
- tmp_files=` grep -r --with-filename $update_service ./tencentcloud | awk -F " :" ' {print $1}' | grep -v " service_tencent*" | awk -F " /" ' {print $3}' | sort | uniq | egrep " ^resource_tc_|^data_source_tc" | awk -F " ." ' {print $1}' | awk ' /_test$/{print "tencentcloud/"$0".go"} !/_test$/{print "tencentcloud/"$0"_test.go"}' `
6
+ for update_service_function in $update_service_functions ; do
7
+ tmp_files=` grep -r --with-filename $update_service_function ./tencentcloud | awk -F " :" ' {print $1}' | grep -v " service_tencent*" | awk -F " /" ' {print $3}' | sort | uniq | egrep " ^resource_tc_|^data_source_tc" | awk -F " ." ' {print $1}' | awk ' /_test$/{print "tencentcloud/"$0".go"} !/_test$/{print "tencentcloud/"$0"_test.go"}' `
8
8
need_test_files=" $need_test_files $tmp_files "
9
9
done
10
10
@@ -17,10 +17,9 @@ delta_test_files="$delta_test_files $need_test_files $update_sources"
17
17
delta_test_files=` echo $delta_test_files | xargs -n1 | sort | uniq`
18
18
for delta_test_file in ${delta_test_files} ; do
19
19
test_casts=` egrep " func TestAcc.+\(" ${delta_test_file} | awk -F " (" ' {print $1}' | awk ' {print $2}' | grep -v " NeedFix" `
20
- echo " [$delta_test_file ]: $test_casts "
20
+ echo " [$delta_test_file ] \n $test_casts "
21
21
for test_cast in ${test_casts} ; do
22
22
go_test_cmd=" go test -v -run ${test_cast} -timeout=0 ./tencentcloud/"
23
- echo ${go_test_cmd}
24
23
$go_test_cmd
25
24
if [ $? -ne 0 ]; then
26
25
printf " [GO TEST FILED] ${go_test_cmd} "
You can’t perform that action at this time.
0 commit comments