Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds end-to-end testing capabilities using Terratest to validate the SonarCloud Terraform provider's resources and data sources in an integrated scenario.
Changes:
- Added comprehensive E2E test suite using Terratest to verify all provider resources and data sources
- Created Terraform fixture with 11 resources and 10 data sources for testing
- Added Makefile targets for running E2E tests with provider installation
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/fixtures/full_e2e/main.tf | Complete Terraform configuration testing all SonarCloud provider resources and data sources |
| test/e2e_full_test.go | Terratest-based E2E test implementation with resource validation and idempotency checks |
| go.mod | Added terratest and testify dependencies for E2E testing |
| Makefile | Added E2E test targets and local installation commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| OS_ARCH?=linux_amd64 | ||
| BINARY_GLOB=./dist/terraform-provider-${NAME}_${OS_ARCH}/terraform* | ||
| # Use wildcard to handle goreleaser's version suffix (e.g., linux_amd64_v1) | ||
| BINARY_GLOB=./dist/terraform-provider-${NAME}_${OS_ARCH}*/terraform-provider-* |
There was a problem hiding this comment.
The wildcard pattern ${OS_ARCH}* may match unintended directories if multiple architecture variants exist. Consider using a more specific pattern or adding validation to ensure only the expected binary is matched.
| install: build | ||
| mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} | ||
| mv $(BINARY_GLOB) ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} | ||
| cp $(BINARY_GLOB) ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}/terraform-provider-${NAME} |
There was a problem hiding this comment.
Using cp with a glob pattern that could match multiple files will fail if more than one file matches. The previous implementation used mv which would also fail with multiple matches, but changing to cp doesn't address the underlying issue. Consider adding validation or using a more specific pattern to ensure exactly one file is matched.
| cp $(BINARY_GLOB) ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}/terraform-provider-${NAME} | |
| set -- $(BINARY_GLOB); \ | |
| if [ "$$#" -ne 1 ] || [ ! -f "$$1" ]; then \ | |
| echo "Expected exactly one build artifact matching '$(BINARY_GLOB)', but found $$# or no valid file."; \ | |
| exit 1; \ | |
| fi; \ | |
| cp "$$1" ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}/terraform-provider-${NAME} |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@renefritze I've opened a new pull request, #43, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
go.mod:3
- Go 1.24.0 does not exist. The latest stable Go version as of January 2026 is 1.23.x. Please verify and use a valid Go version.
go 1.24.0
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.