Fix test_provider scope: use . instead of ./... to avoid cmd/ build failures#2112
Closed
pose wants to merge 4 commits into
Closed
Fix test_provider scope: use . instead of ./... to avoid cmd/ build failures#2112pose wants to merge 4 commits into
pose wants to merge 4 commits into
Conversation
Introduce a Makefile variable GO_TEST_EXEC (defaulting to "go test") that is set to "gotestsum --" on CI via the GitHub Actions workflow env. Also install gotestsum via mise in the test environment. Closes #2106 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous approach set GO_TEST_EXEC in the workflow env and relied on Make's ?= to pick it up. This worked for the sharded path (make test) but not the non-sharded path, which called go test directly in the workflow YAML. This change moves all test invocations through make by: - Adding TESTTAGS ?= all to control build tags (replaces hardcoded -tags=all) - Replacing direct `go test` calls in the non-sharded workflow steps with `make TESTTAGS=<language> GOTESTARGS=<flags> test` GO_TEST_EXEC ?= go test in the Makefile now correctly controls the test executor for both sharded and non-sharded paths, and the workflow env GO_TEST_EXEC: "gotestsum --" is picked up via ?= in both cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The cmd/pulumi-resource-* packages embed a generated schema.json file that does not exist at test time (it requires make tfgen to run first). When make test_provider was changed to be invoked from the workflow, this brought ./... in scope for the first time in CI, causing those cmd/ packages to fail with [setup failed]. Restoring . matches the original workflow behavior (go test . in the provider directory) and avoids compiling binary entrypoints that have no tests and require pre-built artifacts. Fixes breakage reported in: - pulumi/pulumi-postgresql#886 - pulumi/pulumi-newrelic#1312 - pulumi/pulumi-auth0#1098 - pulumi/pulumi-scm#474 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After #2107 was merged, several providers started failing CI with:
Affected providers:
Root Cause
The `cmd/pulumi-resource-*` packages embed a generated `schema.json` file (via `//go:embed`) that only exists after `make tfgen` runs. At test time in CI, this file doesn't exist.
The old workflow ran `go test .` (root package of `provider/` only), which never compiled the `cmd/` packages. After #2107, the `Run provider tests` step was changed to call `make test_provider`, which uses `./...` — and this is the first time the `cmd/` packages were compiled in CI, exposing the pre-existing build failure.
Fix
Change `test_provider_cmd` from `./...` to `.` in the base Makefile template, restoring the original scope (root package of `provider/` only). The `cmd/` packages are binary entrypoints with no tests; they don't belong in the test scope.
Test plan