Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tse): [115706940]support strategy #2526

Merged
merged 3 commits into from
Mar 13, 2024
Merged

feat(tse): [115706940]support strategy #2526

merged 3 commits into from
Mar 13, 2024

Conversation

gitmkn
Copy link
Collaborator

@gitmkn gitmkn commented Feb 7, 2024

No description provided.

@gitmkn gitmkn force-pushed the feat/tse-strategy branch from 5e3e6a5 to 0fb6a7a Compare February 7, 2024 09:47
@gitmkn gitmkn changed the title feat: support strategy [WIP] feat: support strategy Feb 7, 2024
@gitmkn gitmkn force-pushed the feat/tse-strategy branch from b15462e to 391e7f0 Compare March 4, 2024 02:45
@gitmkn gitmkn changed the title [WIP] feat: support strategy feat: support strategy Mar 4, 2024
@gitmkn gitmkn changed the title feat: support strategy feat(tse): [115706940]support strategy Mar 4, 2024
@@ -126,6 +126,12 @@ func ResourceTencentCloudTseCngwGroup() *schema.Resource {
},
},
},

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个变更貌似 changelog 中没有体现

const testAccTseCngwNetwork = `

resource "tencentcloud_tse_cngw_network" "cngw_network" {
gateway_id = "gateway-cf8c99c3"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些都是预置的资源吗

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是开启外网资源,我使用个人账号测试通过,这个只是写了个例子

Steps: []resource.TestStep{
{
Config: testAccTseCngwNetwork,
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_tse_cngw_network.cngw_network", "id")),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

补充修改和删除的测试用例

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是开启外网资源,我使用个人账号测试通过

Delete: resourceTencentCloudTseCngwStrategyBindGroupDelete,
Importer: &schema.ResourceImporter{
State: func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
defaultValues := map[string]interface{}{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段是什么意思呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import时默认bind,这个是绑定操作,如果可以import,那么就是存在棒定关系的,操作就是bind操作

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import给一个默认值

{
Config: testAccTseCngwStrategyBindGroup,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("tencentcloud_tse_cngw_strategy_bind_group.cngw_strategy_bind_group", "id"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里测试用例每个字段都验证下呢

@@ -1200,6 +1201,7 @@ func (me *TseService) DescribeTseGroupsByFilter(ctx context.Context, param map[s
func (me *TseService) CheckTseNativeAPIGatewayGroupStatusById(ctx context.Context, gatewayId, groupId, operate string) (errRet error) {
logId := tccommon.GetLogId(ctx)

time.Sleep(5 * time.Second)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么要 sleep 呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

创建修改后立即查询无法查询到正确的状态,需要等待一下

@gitmkn
Copy link
Collaborator Author

gitmkn commented Mar 13, 2024

image
image
image
image
image

@andrew-tx andrew-tx added the run check run check label Mar 13, 2024
Copy link
Collaborator

@andrew-tx andrew-tx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrew-tx andrew-tx merged commit d0d65c0 into master Mar 13, 2024
8 of 9 checks passed
@andrew-tx andrew-tx deleted the feat/tse-strategy branch March 13, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run check run check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants