Skip to content

[P0] Replace hand-rolled ci-test.yml with the template's ci-integration stage #41

Description

@jacaudi

Rewritten. This issue originally proposed repairing the dorny/test-reporter configuration in ci-test.yml. That premise was wrong. jacaudi/template — the canonical copier template for this fleet's pipeline — uses no test reporter at all, so the fix is to adopt the template's stage rather than repair a hand-rolled one. The original symptom and the two real defects are preserved below for the record.

Symptom

The test job introduced by #39 fails at the Test report step:

Error: Input variable 'reporter' is set to invalid value 'golang-json'

The tests themselves are fine

Verified locally on the #39 branch with envtest:

ok  github.com/.../internal/controller  77.0s
ok  github.com/.../internal/ipam         0.3s
ok  github.com/.../internal/iptables     1.0s

CI also logged generated files match the types, so the codegen drift gate passed too.

Two real defects, both dissolved by adopting the template

1. A reporter failure masks the test result. Fail if tests failed is the step that actually inspects test-report.json for "Action":"fail", and it is skipped once Test report errors. Today a genuinely broken test and a passing one both produce a red ci for the same reason — which defeats the continue-on-error + explicit-gate design.

2. The declared permissions could not have worked anyway. ci-test.yml declares permissions: contents: read, and the run log confirms the job received only Contents: read / Metadata: read. dorny/test-reporter publishes a check run and needs checks: write. Even a valid reporter value would have failed.

The actual resolution

Replace the hand-rolled ci-test.yml with the template's ci-integration.yml (examples/operator-envtest), which has no reporter, no continue-on-error, and therefore neither defect:

- name: go test (envtest)
  run: go test ./... -race -tags=integration

go test exits non-zero on failure and the step fails. That is the whole gate.

Three things to reconcile while adopting it, none blocking:

  • envtest version. The template pins 1.34.x and installs setup-envtest from controller-runtime v0.22.1; this repo is on controller-runtime v0.18.5 / envtest 1.30.0. Keep the repo's versions until the Kubernetes stack upgrade (the follow-up named in [P0] Bump vulnerable transitive dependencies blocking the lint gate #40) lands, rather than mixing a v0.22 tool against v0.18 code.
  • -race. This repo has never run its tests with the race detector. Expect this to surface findings on first run; they are real and worth fixing, but they are new work rather than a regression.
  • -tags=integration. The template's stage builds with that tag; this repo's envtest suite carries no build tag. Either add the tag to the suite or drop it from the stage — decide deliberately, because getting it wrong means the stage compiles and runs zero tests while reporting success.

Acceptance criteria

  • ci-test.yml replaced by the template's ci-integration.yml
  • test stage green on a branch with passing tests
  • test stage red on a branch with a deliberately failing test — verified, not assumed
  • The stage demonstrably runs a non-zero number of tests (guards the -tags trap)
  • Declared permissions match what the steps actually need

Part of the CI alignment onto jacaudi/template. Blocks #37.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions