Skip to content

Fix test_provider scope: use . instead of ./... to avoid cmd/ build failures#2112

Closed
pose wants to merge 4 commits into
masterfrom
pose/chores/make-all-providers-use-gotestsum-2106
Closed

Fix test_provider scope: use . instead of ./... to avoid cmd/ build failures#2112
pose wants to merge 4 commits into
masterfrom
pose/chores/make-all-providers-use-gotestsum-2106

Conversation

@pose

@pose pose commented Mar 16, 2026

Copy link
Copy Markdown
Member

Problem

After #2107 was merged, several providers started failing CI with:

FAIL github.com/pulumi/pulumi-postgresql/provider/v3/cmd/pulumi-resource-postgresql [setup failed]

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

  • CI on this PR passes
  • Re-run CI on one of the affected providers after this merges to confirm the fix

pose and others added 4 commits March 12, 2026 10:16
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>
@pose pose closed this Mar 16, 2026
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.

1 participant