Skip to content

task/terratest_e2e| e2e with terratest#42

Draft
renefritze wants to merge 5 commits intomainfrom
task/terratest_e2e
Draft

task/terratest_e2e| e2e with terratest#42
renefritze wants to merge 5 commits intomainfrom
task/terratest_e2e

Conversation

@renefritze
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings January 16, 2026 16:19
@renefritze renefritze marked this pull request as draft January 16, 2026 16:19
Copy link
Copy Markdown

Copilot AI left a 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 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-*
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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 uses AI. Check for mistakes.
@renefritze
Copy link
Copy Markdown
Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Copy Markdown

Copilot AI commented Jan 19, 2026

@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.

Copilot AI review requested due to automatic review settings January 19, 2026 14:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

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.

4 participants