Skip to content

ConfigStateChecks isn't Compatible with RefreshState #590

@zliang-akamai

Description

@zliang-akamai
=== 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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions