Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

importstate: UseExpectNonEmptyPlan field to ignore no-op assertion for import block test kinds#518

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
austinvalle merged 2 commits intomainfromav/override-noop
Jun 11, 2025

Conversation

@austinvalle
Copy link
Member

@austinvalleaustinvalle commentedJun 2, 2025
edited
Loading

Related Issue

N/A

Description

This change adds the usage of(TestStep).ExpectNonEmptyPlan to ignore the assertion that all import block plans must produce a no-op. A no-op plan isn't possible for some resource types that cannot return the entire original value from the remote API after importing. The usage ofImportPlanChecks can be used to make more fine-grain assertions about the plan to ensure the plan produced during import is correct.

Test failure prior to introducing the change:

--- FAIL: TestImportBlock_WithID_ExpectNonEmptyPlan (0.75s)    /Users/austin.valle/code/terraform-plugin-testing/helper/resource/importstate/import_block_with_id_test.go:105: Step 2/2 error running import: importing resource examplecloud_container.test: expected a no-op import operation, got ["update"] action with plan         stdout:                        Terraform used the selected providers to generate the following execution        plan. Resource actions are indicated with the following symbols:~ update in-place                Terraform will perform the following actions:# examplecloud_container.test will be updated in-place# (imported from "westeurope/somevalue")~ resource"examplecloud_container""test" {~ id       ="westeurope/somevalue" -> (known after apply)~ location ="westeurope" ->"eastus"                name     ="somevalue"            }                Plan: 1 to import, 0 to add, 1 to change, 0 to destroy.FAILFAILgithub.com/hashicorp/terraform-plugin-testing/helper/resource/importstate1.407sFAIL

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Nope.

@austinvalleaustinvalle added this to thev1.13.2 milestoneJun 2, 2025
@austinvalleaustinvalle requested a review froma team as acode ownerJune 2, 2025 11:25
@austinvalleaustinvalle added the bugSomething isn't working labelJun 2, 2025
Copy link
Contributor

@rainkwanrainkwan left a comment

Choose a reason for hiding this comment

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

Looks reasonable, we can revisit the flagging question later if needed.

Copy link
Contributor

@SBGoodsSBGoods left a comment

Choose a reason for hiding this comment

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

I'm also fine with reusingExpectNonEmptyPlan since it's behavior is already well understood.

@austinvalleaustinvalle merged commitbaee5c6 intomainJun 11, 2025
39 checks passed
@austinvalleaustinvalle deleted the av/override-noop branchJune 11, 2025 20:29
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJul 11, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@SBGoodsSBGoodsSBGoods approved these changes

@rainkwanrainkwanrainkwan approved these changes

Assignees

No one assigned

Labels

bugSomething isn't working

Projects

None yet

Milestone

v1.13.2

Development

Successfully merging this pull request may close these issues.

3 participants

@austinvalle@SBGoods@rainkwan

[8]ページ先頭

©2009-2025 Movatter.jp