Releases: hashicorp/terraform-plugin-testing
Releases · hashicorp/terraform-plugin-testing
v1.9.0
v1.8.0
FEATURES:
- plancheck: Added
ExpectDeferredChangeandExpectNoDeferredChangeschecks for experimental deferred action support. (#331) - tfversion: Added
SkipIfNotPrereleaseversion check for testing experimental features of prerelease Terraform builds. (#331)
ENHANCEMENTS:
- helper/acctest: Improve scope of IPv4/IPv6 random address generation in RandIpAddress() (#305)
- knownvalue: Add
TupleExact,TuplePartialandTupleSizeExactchecks for dynamic value testing. (#312) - tfversion: Ensured Terraform CLI prerelease versions are considered semantically equal to patch versions in built-in checks to match the Terraform CLI versioning policy (#303)
- helper/resource: Added
(TestCase).AdditionalCLIOptionswithAllowDeferraloption for plan and apply commands. (#331)
BUG FIXES:
v1.7.0
NOTES:
- helper/resource: Error messages generated by the testing logic, which were updated for clarity in this release, are not protected by compatibility promises. While testing logic errors are usable in certain scenarios with
ErrorCheckandExpectErrorfunctionality, error messaging checks should be based on provider-controlled messaging or when appropriate to use other testing features such asExpectNonEmptyPlaninstead. (#238) - Numerical values in the plan are now represented as json.Number, not float64. Custom plan checks relying upon float64 representation may need altering (#248)
- plancheck: Deprecated
ExpectNullOutputValueandExpectNullOutputValueAtPath. UseExpectKnownOutputValueandExpectKnownOutputValueAtPathwithknownvalue.Nullinstead (#275) - plancheck:
ExpectKnownValue,ExpectKnownOutputValueandExpectKnownOutputValueAtPathplan checks are considered experimental and may be altered or removed in a subsequent release (#276) - statecheck:
ExpectKnownValue,ExpectKnownOutputValueandExpectKnownOutputValueAtPathstate checks are considered experimental and may be altered or removed in a subsequent release (#276) - knownvalue: The
knownvaluepackage is considered experimental and may be altered or removed in a subsequent release (#276) - all: This Go module has been updated to Go 1.21 per the Go support policy. It is recommended to review the Go 1.21 release notes before upgrading. Any consumers building on earlier Go versions may experience errors (#300)
FEATURES:
- plancheck: Added
ExpectKnownValueplan check, which asserts that a given resource attribute has a defined type, and value (#248) - plancheck: Added
ExpectKnownOutputValueplan check, which asserts that a given output value has a defined type, and value (#248) - plancheck: Added
ExpectKnownOutputValueAtPathplan check, which asserts that a given output value at a specified path has a defined type, and value (#248) - knownvalue: Introduced new
knownvaluepackage which contains types for working with plan checks and state checks (#248) - statecheck: Introduced new
statecheckpackage with interface and built-in state check functionality (#275) - statecheck: Added
ExpectKnownValuestate check, which asserts that a given resource attribute has a defined type, and value (#275) - statecheck: Added
ExpectKnownOutputValuestate check, which asserts that a given output value has a defined type, and value (#275) - statecheck: Added
ExpectKnownOutputValueAtPathplan check, which asserts that a given output value at a specified path has a defined type, and value (#275) - statecheck: Added
ExpectSensitiveValuebuilt-in state check, which asserts that a given attribute has a sensitive value (#275)
BUG FIXES:
- helper/resource: Clarified error messaging from testing failures, especially when using
TestStep.PlanOnly: true(#238) - helper/resource: Fix detection of provider block declaration in
Config,ConfigDirectory, andConfigFile(#265) - helper/resource: Fix detection of terraform block declaration in
Config,ConfigDirectory, andConfigFile(#265) - helper/resource: Fixed internal deferred test helpers to properly report file and line information in test failures. (#292)
v1.6.0
NOTES:
- all: This Go module has been updated to Go 1.20 per the Go support policy. It is recommended to review the Go 1.20 release notes before upgrading. Any consumers building on earlier Go versions may experience errors. (#180)
- helper/resource: Configuration based
TestStepnow include post-apply plan checks for output changes in addition to resource changes. If this causes unexpected new test failures, mostoutputconfiguration blocks can be likely be removed. Test steps involving resources and data sources should never need to useoutputconfiguration blocks as plan and state checks support working on resource and data source attributes values directly. (#234) - helper/resource: Implicit
terraform refreshcommands during eachTestStephave been removed to fix plan check and performance issues, which can cause new test failures when testing schema changes (e.g. state upgrades) that have a finalTestStepwithPlanOnly: true. RemovePlanOnly: truefrom the finalTestStepto fix affected tests which will ensure that updated schema changes are applied to the state before attempting to automatically destroy resources. (#223)
FEATURES:
- plancheck: Added
ExpectUnknownOutputValuebuilt-in plan check, which asserts that a given output value at a specified address is unknown (#220) - plancheck: Added
ExpectUnknownOutputValueAtPathbuilt-in plan check, which asserts that a given output value at a specified address, and path is unknown (#220) - plancheck: Added
ExpectNullOutputValuebuilt-in plan check, which asserts that a given output value at a specified address is null (#220) - plancheck: Added
ExpectNullOutputValueAtPathbuilt-in plan check, which asserts that a given output value at a specified address, and path is null (#220)
ENHANCEMENTS:
- helper/resource: Removed separate refresh commands, which increases testing performance (#223)
- helper/resource: Automatically add
required_providersconfiguration toTestStep.ConfigTerraform language configuration when using Terraform >= 1.0.* (#216)
BUG FIXES:
v1.5.1
v1.5.0
FEATURES:
- config: Introduced new
configpackage which contains interfaces and helper functions for working with native Terraform configuration and variables (#153) - helper/resource: Added
TestStep.ConfigDirectoryto allow specifying a directory containing Terraform configuration for use during acceptance tests (#153) - helper/resource: Added
TestStep.ConfigFileto allow specifying a file containing Terraform configuration for use during acceptance tests (#153) - helper/resource: Added
TestStep.ConfigVariablesto allow specifying Terraform variables for use with Terraform configuration during acceptance tests (#153) - helper/resource: Removed data resource and managed resource
idattribute requirement (#84)
ENHANCEMENTS:
- helper/resource: Added
TestSteptypeImportStateVerifyIdentifierAttributefield, which can override the defaultidattribute used for matching prior resource state with imported resource state (#84)
v1.4.0
FEATURES:
- tfjsonpath: Introduced new
tfjsonpathpackage which contains methods that allow traversal of Terraform JSON data (#154) - plancheck: Added
ExpectUnknownValuebuilt-in plan check, which asserts that a given attribute has an unknown value (#154) - plancheck: Added
ExpectSensitiveValuebuilt-in plan check, which asserts that a given attribute has a sensitive value (#154)
v1.3.0
FEATURES:
- tfversion: Introduced new
tfversionpackage with interface and built-in Terraform version check functionality (#128) - tfversion: Added
SkipAbovebuilt-in version check, which skips the test if the Terraform CLI version is above the given maximum. (#128) - tfversion: Added
SkipBelowbuilt-in version check, which skips the test if the Terraform CLI version is below the given minimum. (#128) - tfversion: Added
SkipBetweenbuilt-in version check, which skips the test if the Terraform CLI version is between the given minimum (inclusive) and maximum (exclusive). (#128) - tfversion: Added
SkipIfbuilt-in version check, which skips the test if the Terraform CLI version matches the given version. (#128) - tfversion: Added
RequireAbovebuilt-in version check, which fails the test if the Terraform CLI version is below the given maximum. (#128) - tfversion: Added
RequireBelowbuilt-in version check, which fails the test if the Terraform CLI version is above the given minimum. (#128) - tfversion: Added
RequireBetweenbuilt-in version check, fails the test if the Terraform CLI version is outside the given minimum (exclusive) and maximum (inclusive). (#128) - tfversion: Added
RequireNotbuilt-in version check, which fails the test if the Terraform CLI version matches the given version. (#128) - tfversion: Added
Anybuilt-in version check, which fails the test if none of the given sub-checks return a nil error and empty skip message. (#128) - tfversion: Added
Allbuilt-in version check, which fails or skips the test if any of the given sub-checks return a non-nil error or non-empty skip message. (#128)
BUG FIXES:
- helper/resource: Fix path used when persisting working directory (#113)
v1.2.0
NOTES:
- This Go module has been updated to Go 1.19 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#91)
- helper/resource: Deprecated
PrefixedUniqueId()andUniqueId(). Use thegithub.com/hashicorp/terraform-plugin-sdk/v2/helper/idpackage instead. (#96) - helper/resource: Deprecated
RetryContext(),StateChangeConf, and associated*Errortypes. Use thegithub.com/hashicorp/terraform-plugin-sdk/v2/helper/retrypackage instead. (#96) - helper/resource: Deprecated Terraform module-based
TestCheckFunc, such asTestCheckModuleResourceAttr. Provider testing should always be possible within the root module of a Terraform configuration. Terraform module testing should be performed with Terraform core functionality or using tooling outside this Go module. (#109)
FEATURES:
- plancheck: Introduced new
plancheckpackage with interface and built-in plan check functionality (#63) - plancheck: Added
ExpectResourceActionbuilt-in plan check, which asserts that a given resource will have a specific resource change type in the plan (#63) - plancheck: Added
ExpectEmptyPlanbuilt-in plan check, which asserts that there are no resource changes in the plan (#63) - plancheck: Added
ExpectNonEmptyPlanbuilt-in plan check, which asserts that there is at least one resource change in the plan (#63)
ENHANCEMENTS:
- helper/resource: Added plan check functionality to config and refresh modes with new fields
TestStep.ConfigPlanChecksandTestStep.RefreshPlanChecks(#63)
v1.1.0
FEATURES:
- helper/resource: Added
TF_ACC_PERSIST_WORKING_DIRenvironment variable to allow persisting of Terraform files generated during each test step (#18) - helper/resource: Added
TestCasetypeWorkingDirfield to allow specifying the base directory where testing files used by the testing module are generated (#18)