Skip to content

ci: make the e2e tests actually run - #6

Merged
someson merged 6 commits into
mainfrom
ci/run-e2e-tests
Sep 7, 2026
Merged

someson merged 6 commits into
mainfrom
ci/run-e2e-tests

Conversation

@someson

@someson someson commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Problem

The pty end-to-end tests guard themselves on prerequisites and skip when one is missing:

if bin == "" { t.Skip("bin/azform not built") }

CI never ran make build, so bin/azform never existed, so every e2e test skipped — and a skipped test reports as success. internal/ui finished in ~1.4s on CI instead of ~60s locally. The widget round trip has never been exercised on CI, including the two zsh tests that predate the bash work.

Changes

  • Build the binary before testing, so the tests can run at all.
  • Install zsh on ubuntu-latest, so the zsh tests have their prerequisite.
  • AZFORM_E2E_REQUIRED=1 on ubuntu-latest turns any skip into a hard failure. macos-latest stays permissive: it ships bash 3.2, which genuinely cannot run the bash widget, so that skip is legitimate.

Unrelated bug found along the way

TestDoctorStateNoOverrides fails whenever any AZFORM_* variable is set — including AZFORM_NO_UPDATE_CHECK, which is documented in azform --help. A user who exports it cannot run go test ./... on a clean tree. This is on main today; the new env var merely exposed it.

Cause: t.Setenv(name, "") sets a variable to empty rather than removing it, so os.Environ() still lists NAME= and the doctor counts it as an override. Fixed with os.Unsetenv after t.Setenv.

Verification

Locally, simulating the ubuntu-latest configuration:

Check Result
AZFORM_E2E_REQUIRED=1 go test -race ./... all packages pass, internal/ui 65s
Guard off + binary missing SKIP, run green
Guard on + binary missing FAIL, loudly
AZFORM_NO_UPDATE_CHECK=1 go test ./cmd/azform/ now passes
golangci-lint run 0 issues

The 65s runtime is the signal that the e2e tests really ran.

What this PR is for

Confirming on a real Ubuntu runner that the e2e tests pass under the guard before this reaches main.

@someson
someson merged commit c5c63d2 into main Sep 7, 2026
6 checks passed
@someson
someson deleted the ci/run-e2e-tests branch September 7, 2026 16:23
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