Skip to content

Commit 9c97289

Browse files
tongyimingmikatong
andauthored
update e2e script (#2445)
Co-authored-by: mikatong <mikatong@tencent.com>
1 parent 8f2c3b2 commit 9c97289

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

scripts/changelog-test.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,33 @@ for source_name in $source_names; do
1515
name=${source_name#*/}
1616
type=${source_name%/*}
1717
if [ $type == "datasource" ]; then
18-
type=dataSource
18+
type=DataSource
1919
fi
20-
# echo $source_name $type $name
20+
if [ $type == "resource" ]; then
21+
type=Resource
22+
fi
2123
function_name=$(cat tencentcloud/provider.go | grep "\"${name}\"" | grep "${type}")
2224
function_name=${function_name#*:}
2325
function_name=$(echo $(echo ${function_name%,*}))
24-
25-
test_file=$(grep -r "func $function_name \*schema\.Resource" tencentcloud)
26-
test_file=${test_file#*/}
26+
package=${function_name%.*}
27+
function_name=${function_name#*.}
28+
test_file=$(grep -r "func $function_name \*schema\.Resource" tencentcloud/services/$package)
2729
test_file=${test_file%:*}
2830
test_files="$test_files $test_file"
2931
done
3032
echo "test files:" $test_files
3133

3234
for test_file in $test_files; do
35+
file_path=${test_file%/*}
36+
test_file=${test_file##*/}
3337
test_case_type=${test_file%_tc_*}
3438
test_case_name=${test_file#*_tc_}
3539
test_case_name=${test_case_name%.*}
3640

3741
test_case_type=`echo $test_case_type | sed -r 's/(^|_)(\w)/\U\2/g'`
3842
test_case_name=`echo $test_case_name | sed -r 's/(^|_)(\w)/\U\2/g'`
3943

40-
go_test_cmd="go test -v -run TestAccTencentCloud${test_case_name}${test_case_type} -timeout=0 ./tencentcloud/"
44+
go_test_cmd="go test -v -run TestAccTencentCloud${test_case_name}${test_case_type} -timeout=0 ./$file_path"
4145
echo $go_test_cmd
4246
$go_test_cmd
4347
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)