Skip to content

Remove gotestfmt (second PR)#1072

Merged
t0yv0 merged 5 commits into
masterfrom
t0yv0/remove-gotestfmt-2
Sep 9, 2024
Merged

Remove gotestfmt (second PR)#1072
t0yv0 merged 5 commits into
masterfrom
t0yv0/remove-gotestfmt-2

Conversation

@t0yv0

@t0yv0 t0yv0 commented Sep 6, 2024

Copy link
Copy Markdown
Contributor

Take 2 on removing gotestfmt. Since extension workflows still use it, retain the installation stanza, but not actually use in tests.

pulumi/pulumi-azure-native#3404 is promising but to be evaluated later I think?

Previously: #1069 #1071

@t0yv0 t0yv0 requested a review from a team September 6, 2024 15:36
@corymhall

Copy link
Copy Markdown
Member

Also for evaluation later is gotestsum. It supports the github actions format and will stream the results so you see the results of the tests as they finish. I've been using it in pulumi-cdk and it seems to work well.

https://github.com/pulumi/pulumi-cdk/blob/0cad9088ca9007cc5942c578b8e62588df82f5bc/.github/workflows/run-acceptance-tests.yml#L101

@t0yv0 t0yv0 added this pull request to the merge queue Sep 9, 2024
Merged via the queue into master with commit 99efc2e Sep 9, 2024
@t0yv0 t0yv0 deleted the t0yv0/remove-gotestfmt-2 branch September 9, 2024 14:28
@blampe blampe mentioned this pull request Nov 12, 2024
3 tasks
@t0yv0 t0yv0 changed the title Rremove gotestfmt 2 take 2 Remove gotestfmt 2 take 2 Nov 22, 2024
@t0yv0 t0yv0 changed the title Remove gotestfmt 2 take 2 Remove gotestfmt (second PR) Nov 22, 2024
github-merge-queue Bot pushed a commit that referenced this pull request Mar 12, 2026
Fixes #2106.

## Context

We previously used
[`gotestfmt`](#1069) to improve
test output readability on CI, but it was
[removed](#1072) because it was
mis-attributing logs from one test to another and not reporting logs
when a panic was encountered — making failures harder to diagnose rather
than easier.

`gotestsum` is a more robust alternative. This PR introduces two
Makefile variables:
- `GO_TEST_EXEC ?= go test` — set to `"gotestsum --format github-actions
--"` on CI via the workflow `env:` block
- `TESTTAGS ?= all` — overridden per-language in the non-shorted matrix
path

## Why the workflow had to change too

An earlier attempt set `GO_TEST_EXEC` in the workflow env and relied on
Make's `?=` to pick it up. This worked for the **sharded path** (which
calls `make test`), but not the **non-sharded path**, which called `go
test` directly in the workflow YAML — bypassing the Makefile entirely.
awsx uses the non-sharded path, so `GO_TEST_EXEC` was never consulted.

This change moves all test invocations through `make` so `GO_TEST_EXEC`
is always honoured, and also aligns with the strategic goal of keeping
workflows "dumb" — test logic lives in the Makefile, not scattered
across workflow YAML.

## Changes

- Add `GO_TEST_EXEC ?= go test` and `TESTTAGS ?= all` to both `base` and
`parameterized-go` Makefile templates
- Use `$(GO_TEST_EXEC)` and `$(TESTTAGS)` in `test` and `test_provider`
make targets
- Set `GO_TEST_EXEC: "gotestsum --format github-actions --"` in the test
workflow's global `env:`
- Replace non-sharded `go test` workflow steps with `make
TESTTAGS=<language> GOTESTARGS=<flags> test`
- Add `gotestsum` via aqua to `mise.test.toml` so it is installed in
test workflow environments

## Test plan

- [x] `make test-go test-providers` passes — all 15 test providers
regenerate and pass actionlint
- [x] Verify gotestsum output on a real provider CI run — sample run:
pulumi/pulumi-awsx#1907
- Works like a charm! <img width="984" height="606" alt="image"
src="https://github.com/user-attachments/assets/79e08f6a-4ec0-4483-93f6-f32f6d77406a"
/>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

3 participants