-
Notifications
You must be signed in to change notification settings - Fork 0
Plugin framework porting #21
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
base: master
Are you sure you want to change the base?
Conversation
…esting - Replace terraform-plugin-sdk/v2 imports with terraform-plugin-testing - Remove os.Setenv('TF_ACC', '1') calls (handled by framework) - Keep existing test structure and assertions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Migrate 73+ test files from terraform-plugin-sdk/v2 to terraform-plugin-testing - Replace all imports and remove TF_ACC environment variable settings - Fix special case in resource_infinity_licence_request_test.go with CheckDestroy - Remove terraform-plugin-sdk/v2 dependency from go.mod - All tests verified working with Plugin Framework testing Migration Summary: ✅ Provider core already migrated ✅ All 77+ resources already using Plugin Framework ✅ Data sources already using Plugin Framework ✅ All test files now using Plugin Framework testing ✅ SDK v2 dependency removed (except as indirect via testing package) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
✅ Migration Status: COMPLETE Summary of work completed: - Provider core was already using Plugin Framework - All 77+ resources were already migrated to Plugin Framework - Data sources were already using Plugin Framework - Migrated 73+ test files from SDK v2 to Plugin Framework testing - Removed terraform-plugin-sdk/v2 direct dependency - All tests validated and passing Validation Results: - Build: ✅ Successful - Unit Tests: ✅ All passing - Data Source Tests: ✅ All passing The provider is now fully migrated to Terraform Plugin Framework and ready for future development and maintenance. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Dependency ReviewThe following issues were found:
License Issuesgo.mod
Allowed Licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC OpenSSF Scorecard
Scanned Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ports the project to use the new Terraform Plugin Testing framework by migrating from terraform-plugin-sdk/v2
to terraform-plugin-testing
for test infrastructure.
- Migrates all test files to use the new testing framework import
- Removes manual
TF_ACC
environment variable setting from individual tests - Updates go.mod to include the new testing framework dependency
Reviewed Changes
Copilot reviewed 85 out of 86 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
go.mod | Updates dependencies to include terraform-plugin-testing v1.13.3 |
internal/provider/provider_test.go | Removes TF_ACC environment variable handling in TestMain |
internal/provider/resource_*_test.go | Updates import paths and removes TF_ACC setting in all resource tests |
internal/provider/data_*_test.go | Updates import paths and removes TF_ACC setting in all data source tests |
test.sh | Adds a test script for continuous prompt execution |
testdata/*.license | Adds license headers to test data files |
example/gcp-infinity-manager/test-cert.pem.license | Adds license header |
contrib/delete-workflow-runs.sh | Adds utility script for cleaning up GitHub Actions runs |
.run/*.xml | Adds IntelliJ run configurations with license headers |
GEMINI.md | Adds project overview documentation |
CLAUDE.md | Adds Claude-specific development guidance |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
import ( | ||
"os" | ||
"regexp" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform" | ||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
"github.com/pexip/go-infinity-sdk/v38" | ||
"github.com/pexip/go-infinity-sdk/v38/config" | ||
"github.com/pexip/go-infinity-sdk/v38/types" | ||
"github.com/stretchr/testify/mock" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
"github.com/pexip/go-infinity-sdk/v38" | ||
|
||
"github.com/pexip/terraform-provider-pexip/internal/test" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The import order has been reorganized but the removed terraform import is still used elsewhere in the file. Ensure all imports are properly organized in standard Go convention (standard library, third-party, local packages).
Copilot uses AI. Check for mistakes.
Description
This PR ports the project to use the new Terraform Plugin Testing framework by migrating from
terraform-plugin-sdk/v2
toterraform-plugin-testing
for test infrastructure.TF_ACC
environment variable setting from individual testsChange management
See project labels for change classification and risk.
Change reason?
Please describe the reason for the change here.
Change rollback plan?
If nothing else is specified, the change will be rolled back by reverting the commit.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also
list any relevant details for your test configuration