Skip to content

Commit 73ccfd5

Browse files
authored
Feat/pg e2e case fix (#1967)
* example readjust: tencentcloud_kubernetes_serverless_node_pool * add pre-commit-local * adjust e2e case
1 parent da85151 commit 73ccfd5

File tree

28 files changed

+267
-58
lines changed

28 files changed

+267
-58
lines changed

tencentcloud/data_source_tc_postgresql_backup_download_urls_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ func TestAccTencentCloudPostgresqlBackupDownloadUrlsDataSource_basic(t *testing.
1919
Providers: testAccProviders,
2020
Steps: []resource.TestStep{
2121
{
22+
PreConfig: func() {
23+
testAccStepSetRegion(t, "ap-guangzhou")
24+
testAccPreCheckCommon(t, ACCOUNT_TYPE_COMMON)
25+
},
2226
// Config: fmt.Sprintf(testAccPostgresqlBackupDownloadUrlsDataSource, startTime, endTime),
2327
Config: testAccPostgresqlBackupDownloadUrlsDataSource,
2428
Check: resource.ComposeTestCheckFunc(
@@ -40,7 +44,7 @@ func TestAccTencentCloudPostgresqlBackupDownloadUrlsDataSource_basic(t *testing.
4044
})
4145
}
4246

43-
const testAccPostgresqlBackupDownloadUrlsDataSource = CommonPresetPGSQL + defaultVpcSubnets + `
47+
const testAccPostgresqlBackupDownloadUrlsDataSource = OperationPresetPGSQL + defaultVpcSubnets + `
4448
data "tencentcloud_postgresql_log_backups" "log_backups" {
4549
min_finish_time = ""
4650
max_finish_time = ""
@@ -55,8 +59,8 @@ data "tencentcloud_postgresql_log_backups" "log_backups" {
5559
data "tencentcloud_postgresql_backup_download_urls" "backup_download_urls" {
5660
db_instance_id = local.pgsql_id
5761
backup_type = "LogBackup"
58-
// backup_id = data.tencentcloud_postgresql_log_backups.log_backups.log_backup_set.0.id
59-
backup_id = "01a57d08-b7f5-584e-b64a-dc2236bb0438"
62+
backup_id = data.tencentcloud_postgresql_log_backups.log_backups.log_backup_set.0.id
63+
// backup_id = "01a57d08-b7f5-584e-b64a-dc2236bb0438"
6064
url_expire_time = 12
6165
backup_download_restriction {
6266
restriction_type = "NONE"

tencentcloud/data_source_tc_postgresql_base_backups_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func TestAccTencentCloudPostgresqlBaseBackupsDataSource_basic(t *testing.T) {
1818
resource.Test(t, resource.TestCase{
1919
PreCheck: func() {
2020
testAccPreCheck(t)
21+
testAccStepSetRegion(t, "ap-chengdu")
2122
},
2223
Providers: testAccProviders,
2324
Steps: []resource.TestStep{

tencentcloud/data_source_tc_postgresql_db_instance_classes_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ func TestAccTencentCloudPostgresqlDbInstanceClassesDataSource_basic(t *testing.T
1616
Steps: []resource.TestStep{
1717
{
1818
Config: testAccPostgresqlDbInstanceClassesDataSource,
19+
PreConfig: func() {
20+
testAccStepSetRegion(t, "ap-guangzhou")
21+
testAccPreCheckCommon(t, ACCOUNT_TYPE_COMMON)
22+
},
1923
Check: resource.ComposeTestCheckFunc(
2024
testAccCheckTencentCloudDataSourceID("data.tencentcloud_postgresql_db_instance_classes.db_instance_classes"),
2125
resource.TestCheckResourceAttr("data.tencentcloud_postgresql_db_instance_classes.db_instance_classes", "zone", "ap-guangzhou-7"),

tencentcloud/data_source_tc_postgresql_db_instance_versions_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ func TestAccTencentCloudPostgresqlDbInstanceVersionsDataSource_basic(t *testing.
1010
t.Parallel()
1111
resource.Test(t, resource.TestCase{
1212
PreCheck: func() {
13+
testAccStepSetRegion(t, "ap-guangzhou")
1314
testAccPreCheck(t)
1415
},
1516
Providers: testAccProviders,
1617
Steps: []resource.TestStep{
1718
{
1819
Config: testAccPostgresqlDbInstanceVersionsDataSource,
20+
PreConfig: func() {
21+
testAccStepSetRegion(t, "ap-guangzhou")
22+
testAccPreCheckCommon(t, ACCOUNT_TYPE_COMMON)
23+
},
1924
Check: resource.ComposeTestCheckFunc(
2025
testAccCheckTencentCloudDataSourceID("data.tencentcloud_postgresql_db_instance_versions.db_instance_versions"),
2126
resource.TestCheckResourceAttrSet("data.tencentcloud_postgresql_db_instance_versions.db_instance_versions", "version_set.#"),

tencentcloud/data_source_tc_postgresql_default_parameters_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ func TestAccTencentCloudPostgresqlDefaultParametersDataSource_basic(t *testing.T
1010
t.Parallel()
1111
resource.Test(t, resource.TestCase{
1212
PreCheck: func() {
13+
testAccStepSetRegion(t, "ap-guangzhou")
1314
testAccPreCheck(t)
1415
},
1516
Providers: testAccProviders,
1617
Steps: []resource.TestStep{
1718
{
1819
Config: testAccPostgresqlDefaultParametersDataSource,
20+
PreConfig: func() {
21+
testAccStepSetRegion(t, "ap-guangzhou")
22+
testAccPreCheckCommon(t, ACCOUNT_TYPE_COMMON)
23+
},
1924
Check: resource.ComposeTestCheckFunc(
2025
testAccCheckTencentCloudDataSourceID("data.tencentcloud_postgresql_default_parameters.default_parameters"),
2126
resource.TestCheckResourceAttr("data.tencentcloud_postgresql_default_parameters.default_parameters", "db_major_version", "13"),

tencentcloud/data_source_tc_postgresql_instances_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ var testDataPostgresqlInstancesName = "data.tencentcloud_postgresql_instances.id
1111
func TestAccTencentCloudPostgresqlInstancesDataSource(t *testing.T) {
1212
t.Parallel()
1313
resource.Test(t, resource.TestCase{
14-
PreCheck: func() { testAccPreCheck(t) },
14+
PreCheck: func() {
15+
testAccStepSetRegion(t, "ap-guangzhou")
16+
testAccPreCheck(t)
17+
},
1518
Providers: testAccProviders,
1619
CheckDestroy: testAccCheckLBDestroy,
1720
Steps: []resource.TestStep{
1821
{
1922
Config: testAccTencentCloudDataPostgresqlInstanceBasic,
23+
PreConfig: func() {
24+
testAccStepSetRegion(t, "ap-guangzhou")
25+
testAccPreCheckCommon(t, ACCOUNT_TYPE_COMMON)
26+
},
2027
Check: resource.ComposeTestCheckFunc(
2128
resource.TestCheckResourceAttr(testDataPostgresqlInstancesName, "instance_list.#", "1"),
2229
resource.TestCheckResourceAttrSet(testDataPostgresqlInstancesName, "instance_list.0.id"),

tencentcloud/data_source_tc_postgresql_log_backups.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func dataSourceTencentCloudPostgresqlLogBackupsRead(d *schema.ResourceData, meta
181181
}
182182
tmpSet = append(tmpSet, &filter)
183183
}
184-
paramMap["filters"] = tmpSet
184+
paramMap["Filters"] = tmpSet
185185
}
186186

187187
if v, ok := d.GetOk("order_by"); ok {

tencentcloud/data_source_tc_postgresql_log_backups_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ func TestAccTencentCloudPostgresqlLogBackupsDataSource_basic(t *testing.T) {
1515
endTime := time.Now().AddDate(0, 0, 1).In(loc).Format("2006-01-02 15:04:05")
1616
resource.Test(t, resource.TestCase{
1717
PreCheck: func() {
18+
testAccStepSetRegion(t, "ap-guangzhou")
1819
testAccPreCheck(t)
1920
},
2021
Providers: testAccProviders,
2122
Steps: []resource.TestStep{
2223
{
2324
Config: fmt.Sprintf(testAccPostgresqlLogBackupsDataSource, startTime, endTime),
25+
PreConfig: func() {
26+
testAccStepSetRegion(t, "ap-guangzhou")
27+
testAccPreCheckCommon(t, ACCOUNT_TYPE_COMMON)
28+
},
2429
Check: resource.ComposeTestCheckFunc(
2530
testAccCheckTencentCloudDataSourceID("data.tencentcloud_postgresql_log_backups.log_backups"),
2631
resource.TestCheckResourceAttr("data.tencentcloud_postgresql_log_backups.log_backups", "min_finish_time", startTime),

tencentcloud/data_source_tc_postgresql_parameter_templates_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ func TestAccTencentCloudPostgresqlParameterTemplatesDataSource_basic(t *testing.
1010
t.Parallel()
1111
resource.Test(t, resource.TestCase{
1212
PreCheck: func() {
13+
testAccStepSetRegion(t, "ap-guangzhou")
1314
testAccPreCheck(t)
1415
},
1516
Providers: testAccProviders,
1617
Steps: []resource.TestStep{
1718
{
1819
Config: testAccPostgresqlParameterTemplatesDataSource,
20+
PreConfig: func() {
21+
testAccStepSetRegion(t, "ap-guangzhou")
22+
testAccPreCheckCommon(t, ACCOUNT_TYPE_COMMON)
23+
},
1924
Check: resource.ComposeTestCheckFunc(
2025
testAccCheckTencentCloudDataSourceID("data.tencentcloud_postgresql_parameter_templates.parameter_templates"),
2126
resource.TestCheckResourceAttr("data.tencentcloud_postgresql_parameter_templates.parameter_templates", "filters.#", "2"),

tencentcloud/data_source_tc_postgresql_readonly_groups_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ func TestAccTencentCloudPostgresqlReadonlyGroupsDataSource_basic(t *testing.T) {
1212
t.Parallel()
1313
resource.Test(t, resource.TestCase{
1414
PreCheck: func() {
15+
testAccStepSetRegion(t, "ap-guangzhou")
1516
testAccPreCheck(t)
1617
},
1718
Providers: testAccProviders,

0 commit comments

Comments
 (0)