hashicorp / hashicorp/terraform-plugin-testing

`ConfigStateChecks` isn't Compatible with `RefreshState`

Open
#590 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
68
Forks
22
Avg merge
2d 12h
Merged PRs (30d)
1

Description

```
=== RUN TestAccResourceInstance_withLock
resource_test.go:3511: Test validation error: TestStep 2/2 validation error: TestStep ConfigStateChecks must only be specified with Config, ConfigDirectory or ConfigFile
```

Sample code:

```go
resource.TestStep{
RefreshState: true,
ConfigStateChecks: []statecheck.StateCheck{
statecheck.ExpectKnownValue(
resourceName,
tfjsonpath.New("some_attr"),
knownvalue.StringExact("some_string_value"),
),
},
}
```

Is there any way to assert the some known values for state of some attributes on a resource when `RefreshState: true`?

Query mode seems to be too complicated and I am not really testing for `terraform query` command.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.