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

Refresh before applying test step. #515

Merged
merged 1 commit into from
Jul 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion helper/resource/testing_new_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ func testStepNewConfig(t testing.T, c TestCase, wd *tftest.WorkingDir, step Test

wd.RequireSetConfig(t, step.Config)

// require a refresh before applying
// failing to do this will result in data sources not being updated
err := runProviderCommand(t, func() error {
wd.RequireRefresh(t)
return nil
}, wd, c.ProviderFactories)
if err != nil {
return err
}

if !step.PlanOnly {
err := runProviderCommand(t, func() error {
return wd.Apply()
Expand Down Expand Up @@ -61,7 +71,7 @@ func testStepNewConfig(t testing.T, c TestCase, wd *tftest.WorkingDir, step Test
// Test for perpetual diffs by performing a plan, a refresh, and another plan

// do a plan
err := runProviderCommand(t, func() error {
err = runProviderCommand(t, func() error {
wd.RequireCreatePlan(t)
return nil
}, wd, c.ProviderFactories)
Expand Down