Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate testing framework to terraform-plugin-testing #185

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

fantapop
Copy link
Collaborator

@fantapop fantapop commented Mar 13, 2024

Previously, the terraform provider utilized the sdkv2 framework. In order to stay up to date with testing framework improvements we upgrade to the new terraform-plugin-testing framework following these instructions:

https://developer.hashicorp.com/terraform/plugin/testing/migrating

The change that instigated this upgrade is that the id field is no longer required in the new framework. During development of the role_grant_resource an ID was not used because the ccapi does not provide an ID for it. Rather than work around this using a synthetic ID, we upgrade.

Commit checklist

  • Changelog
  • Doc gen (make generate)
  • Integration test(s)
  • Acceptance test(s)
  • Example(s)

@fantapop fantapop force-pushed the upgrade-testing-framework branch 11 times, most recently from dd9cd3f to d411660 Compare March 14, 2024 00:06
@fantapop fantapop marked this pull request as ready for review March 14, 2024 16:00
Previously, the terraform provider utilized the sdkv2 framework. In order to
stay up to date with testing framework improvements we upgrade to the new
terraform-plugin-testing framework following these instructions:

https://developer.hashicorp.com/terraform/plugin/testing/migrating

The change that instigated this upgrade is that the id field is no longer
required in the new framework.  During development of the role_grant_resource
an ID was not used because the ccapi does not provide it.  Rather than working
around this using a synthetic ID, we upgrade.

Included with this migration are various changes including:
* updating github action versions
* update code to use new libraries provided by the updated framework.
* update to use go 1.21
* fixed some broken examples
* integration test changes required by the operation of the new framework.
  Namely there are different amounts of Read calls made by the new framework.
  Some tests had call counts encoded into them and need to be updated.
@fantapop fantapop force-pushed the upgrade-testing-framework branch from d411660 to 66c4c50 Compare March 14, 2024 16:02
@fantapop
Copy link
Collaborator Author

@carloruiz / @andy-kimball as recent contributors to the terraform provider, I've added you two here as reviewers.

@fantapop
Copy link
Collaborator Author

The changes are separated into 2 commits, one with all the vendor changes. Don't let the 1600+ file counts scare you since its mostly vendor.

Copy link
Contributor

@andy-kimball andy-kimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fantapop fantapop merged commit 3e7b9af into main Mar 14, 2024
3 checks passed
@fantapop fantapop deleted the upgrade-testing-framework branch March 14, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants