Closed bflad closed 3 months ago
This type of change should probably also occur on the other functions, but I wanted to first gauge feelings on the highest impact function, since there is expected to be a number of provider-facing core features in the coming releases.
Great idea, @SBGoods! I'm going to merge this in since I'm not sure when I'm going to be able to do the rest, but will keep that in mind. 👍
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Reference: https://github.com/hashicorp/terraform-plugin-testing/issues/303 Reference: https://github.com/hashicorp/terraform-plugin-testing/pull/308
This change is mainly due to the internals of how github.com/hashicorp/go-version treats version comparisons when there is prerelease data. When the running Terraform CLI is a prerelease version and the given version is a patch version,
SkipBelow
will currently skip the test. However, Terraform CLI prerelease versions are semantically treated as candidates for the associated patch version and therefore should be tested. This adjustsSkipBelow
for that intended behavior. In the unexpected use case that prerelease version checking is still needed, callers can (still) opt into giving a prerelease version, which will perform the check including prerelease data.The unit testing for the
tfversion
package skip functionality is still manual becausegithub.com/mitchellh/go-testing-interface
will not immediately stop the test logic Goroutine when the equivalent of(*testing.T).Skip()
is called nor does it provide helpful troubleshooting information should a test fail as it raises a panic with a generic error message. Future changes could switch to using a different testing interface, however they would require a breaking change to the exported API of this Go module, so that design and effort is being done separately.With the addition of the new tests, but no logic changes:
After logic changes (note only difference is
Test_SkipBelow_Prerelease_EqualCoreVersion
):