Skip to content

Releases: hashicorp/terraform-plugin-testing

v1.11.0

19 Nov 14:50
Compare
Choose a tag to compare

NOTES:

  • all: This Go module has been updated to Go 1.22 per the Go support policy. It is recommended to review the Go 1.22 release notes before upgrading. Any consumers building on earlier Go versions may experience errors. (#371)
  • echoprovider: The echoprovider package is considered experimental and may be altered or removed in a subsequent release (#389)

FEATURES:

  • tfversion: Added SkipIfNotAlpha version check for testing experimental features of alpha Terraform builds. (#388)
  • echoprovider: Introduced new echoprovider package, which contains a v6 Terraform provider that can be used to test ephemeral resource data. (#389)

v1.10.0

08 Aug 21:31
Compare
Choose a tag to compare

NOTES:

  • compare: The compare package is considered experimental and may be altered or removed in a subsequent release (#330)
  • statecheck: CompareValue, CompareValueCollection, and CompareValuePairs state checks are considered experimental and may be altered or removed in a subsequent release. (#330)

FEATURES:

  • compare: Introduced new compare package, which contains interfaces and implementations for value comparisons in state checks. (#330)
  • statecheck: Added CompareValue state check, which compares sequential values of the specified attribute at the given managed resource, or data source, using the supplied value comparer. (#330)
  • statecheck: Added CompareValueCollection state check, which compares each item in the specified collection (e.g., list, set) attribute, with the second specified attribute at the given managed resources, or data sources, using the supplied value comparer. (#330)
  • statecheck: Added CompareValuePairs state check, which compares the specified attributes at the given managed resources, or data sources, using the supplied value comparer. (#330)

v1.9.0

09 Jul 15:39
Compare
Choose a tag to compare

ENHANCEMENTS:

  • knownvalue: Add Int32Exact check for int32 value testing. (#356)
  • knownvalue: Add Float32Exact check for float32 value testing. (#356)

v1.8.0

17 May 15:49
Compare
Choose a tag to compare

FEATURES:

  • plancheck: Added ExpectDeferredChange and ExpectNoDeferredChanges checks for experimental deferred action support. (#331)
  • tfversion: Added SkipIfNotPrerelease version 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, TuplePartial and TupleSizeExact checks 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).AdditionalCLIOptions with AllowDeferral option for plan and apply commands. (#331)

BUG FIXES:

  • helper/resource: Fix panic in output state shimming when a tuple is present. (#310)
  • tfversion: Fixed RequireBelow ignoring equal versioning to fail a test (#303)

v1.7.0

05 Mar 15:33
Compare
Choose a tag to compare

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 ErrorCheck and ExpectError functionality, error messaging checks should be based on provider-controlled messaging or when appropriate to use other testing features such as ExpectNonEmptyPlan instead. (#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 ExpectNullOutputValue and ExpectNullOutputValueAtPath. Use ExpectKnownOutputValue and ExpectKnownOutputValueAtPath with knownvalue.Null instead (#275)
  • plancheck: ExpectKnownValue, ExpectKnownOutputValue and ExpectKnownOutputValueAtPath plan checks are considered experimental and may be altered or removed in a subsequent release (#276)
  • statecheck: ExpectKnownValue, ExpectKnownOutputValue and ExpectKnownOutputValueAtPath state checks are considered experimental and may be altered or removed in a subsequent release (#276)
  • knownvalue: The knownvalue package 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 ExpectKnownValue plan check, which asserts that a given resource attribute has a defined type, and value (#248)
  • plancheck: Added ExpectKnownOutputValue plan check, which asserts that a given output value has a defined type, and value (#248)
  • plancheck: Added ExpectKnownOutputValueAtPath plan check, which asserts that a given output value at a specified path has a defined type, and value (#248)
  • knownvalue: Introduced new knownvalue package which contains types for working with plan checks and state checks (#248)
  • statecheck: Introduced new statecheck package with interface and built-in state check functionality (#275)
  • statecheck: Added ExpectKnownValue state check, which asserts that a given resource attribute has a defined type, and value (#275)
  • statecheck: Added ExpectKnownOutputValue state check, which asserts that a given output value has a defined type, and value (#275)
  • statecheck: Added ExpectKnownOutputValueAtPath plan check, which asserts that a given output value at a specified path has a defined type, and value (#275)
  • statecheck: Added ExpectSensitiveValue built-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, and ConfigFile (#265)
  • helper/resource: Fix detection of terraform block declaration in Config, ConfigDirectory, and ConfigFile (#265)
  • helper/resource: Fixed internal deferred test helpers to properly report file and line information in test failures. (#292)

v1.6.0

04 Dec 14:53
Compare
Choose a tag to compare

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 TestStep now include post-apply plan checks for output changes in addition to resource changes. If this causes unexpected new test failures, most output configuration blocks can be likely be removed. Test steps involving resources and data sources should never need to use output configuration blocks as plan and state checks support working on resource and data source attributes values directly. (#234)
  • helper/resource: Implicit terraform refresh commands during each TestStep have 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 final TestStep with PlanOnly: true. Remove PlanOnly: true from the final TestStep to 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 ExpectUnknownOutputValue built-in plan check, which asserts that a given output value at a specified address is unknown (#220)
  • plancheck: Added ExpectUnknownOutputValueAtPath built-in plan check, which asserts that a given output value at a specified address, and path is unknown (#220)
  • plancheck: Added ExpectNullOutputValue built-in plan check, which asserts that a given output value at a specified address is null (#220)
  • plancheck: Added ExpectNullOutputValueAtPath built-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_providers configuration to TestStep.Config Terraform language configuration when using Terraform >= 1.0.* (#216)

BUG FIXES:

  • plancheck: Ensured ExpectEmptyPlan and ExpectNonEmptyPlan account for output changes (#222)
  • helper/resource: Ensured TestStep.ExpectNonEmptyPlan accounts for output changes with Terraform 0.14 and later (#234)

v1.5.1

31 Aug 17:15
Compare
Choose a tag to compare

BUG FIXES:

  • helper/resource: Fix regression by allowing providers to be defined both at the TestCase level, and within TestStep.Config (#177)

v1.5.0

31 Aug 11:29
Compare
Choose a tag to compare

FEATURES:

  • config: Introduced new config package which contains interfaces and helper functions for working with native Terraform configuration and variables (#153)
  • helper/resource: Added TestStep.ConfigDirectory to allow specifying a directory containing Terraform configuration for use during acceptance tests (#153)
  • helper/resource: Added TestStep.ConfigFile to allow specifying a file containing Terraform configuration for use during acceptance tests (#153)
  • helper/resource: Added TestStep.ConfigVariables to allow specifying Terraform variables for use with Terraform configuration during acceptance tests (#153)
  • helper/resource: Removed data resource and managed resource id attribute requirement (#84)

ENHANCEMENTS:

  • helper/resource: Added TestStep type ImportStateVerifyIdentifierAttribute field, which can override the default id attribute used for matching prior resource state with imported resource state (#84)

v1.4.0

24 Jul 14:27
Compare
Choose a tag to compare

FEATURES:

  • tfjsonpath: Introduced new tfjsonpath package which contains methods that allow traversal of Terraform JSON data (#154)
  • plancheck: Added ExpectUnknownValue built-in plan check, which asserts that a given attribute has an unknown value (#154)
  • plancheck: Added ExpectSensitiveValue built-in plan check, which asserts that a given attribute has a sensitive value (#154)

v1.3.0

13 Jun 13:51
Compare
Choose a tag to compare

FEATURES:

  • tfversion: Introduced new tfversion package with interface and built-in Terraform version check functionality (#128)
  • tfversion: Added SkipAbove built-in version check, which skips the test if the Terraform CLI version is above the given maximum. (#128)
  • tfversion: Added SkipBelow built-in version check, which skips the test if the Terraform CLI version is below the given minimum. (#128)
  • tfversion: Added SkipBetween built-in version check, which skips the test if the Terraform CLI version is between the given minimum (inclusive) and maximum (exclusive). (#128)
  • tfversion: Added SkipIf built-in version check, which skips the test if the Terraform CLI version matches the given version. (#128)
  • tfversion: Added RequireAbove built-in version check, which fails the test if the Terraform CLI version is below the given maximum. (#128)
  • tfversion: Added RequireBelow built-in version check, which fails the test if the Terraform CLI version is above the given minimum. (#128)
  • tfversion: Added RequireBetween built-in version check, fails the test if the Terraform CLI version is outside the given minimum (exclusive) and maximum (inclusive). (#128)
  • tfversion: Added RequireNot built-in version check, which fails the test if the Terraform CLI version matches the given version. (#128)
  • tfversion: Added Any built-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 All built-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)