Skip to content

Commit 2babe69

Browse files
committed
chore: make testing appid configurable through env-var
1 parent e44dc0c commit 2babe69

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,24 @@ log.Println("[DEBUG] the message and some import values: %v", importantValues)
8282
### Test
8383

8484
The quicker way for development and debug is writing test cases.
85-
How to trigger running the test cases, please refer the `test.sh` script.
86-
How to write test cases, check the `xxx_test.go` files.
85+
86+
Config environment variables:
87+
```
88+
export TF_ACC=true
89+
```
90+
91+
Config your appid for COS bucket testing
92+
```
93+
export TENCENTCLOUD_APPID=1234567890
94+
```
95+
96+
This example show how to test single test function:
97+
```
98+
cd tencentcloud
99+
go test -i; go test -test.run TestAccTencentCloudNatGateway_basic -v
100+
```
101+
102+
To write test cases, check the `xxx_test.go` files for more reference.
87103

88104
### Avoid ``terrafrom init``
89105

tencentcloud/basic_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package tencentcloud
22

3+
import "os"
34
/*
45
---------------------------------------------------
56
If you want to run through the test cases,
67
the following must be changed to your resource id.
78
---------------------------------------------------
89
*/
910

10-
const appid string = "1259649581"
11+
var appid string = os.Getenv("TENCENTCLOUD_APPID")
1112

1213
const (
1314
defaultRegion = "ap-guangzhou"

0 commit comments

Comments
 (0)