Skip to content

Run the tests with go test instead of go-acc, and test Go 1.26 and 1.27 - #10

Merged
laodouya merged 2 commits into
developfrom
ci/go-test-coverage
Nov 6, 2026
Merged

laodouya merged 2 commits into
developfrom
ci/go-test-coverage

Conversation

@laodouya

@laodouya laodouya commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

The test job installs github.com/ory/go-acc@latest on every run, with its own dependencies (Cobra, Viper and others), to collect coverage. go-acc is archived. With a single package it only runs go test with a coverage profile of that package, which go test writes by itself, and with -race the cover mode is atomic, as go-acc set it. The first commit runs go test -race -v -coverprofile=coverage.txt -tags "…" in each step instead and drops the install and PATH steps.

The matrix tested Go 1.24, 1.25 and 1.26, but CovenantSQL builds this package with Go 1.27 (its ci.yml and builder image). The second commit tests Go 1.26 and 1.27, the two releases Go supports. go.mod stays at go 1.21: nothing here needs a newer language version.

CI only; the package does not change.

Left out:

  • The Codecov upload fails on every run, on develop too, with Token required because branch is protected (fail_ci_if_error is false, so the job still passes), so the coverage reaches nobody. Adding a CODECOV_TOKEN secret, or dropping the upload and -coverprofile, is a separate decision. The step's file input, which codecov-action v5 reports as unexpected, is also left as it is.
  • Each step still overwrites coverage.txt, as with go-acc, so only the last tag set would be uploaded.
  • GitHub Actions versions, the MSYS2 environment of the Windows job (which only runs go build), and a job for Go 1.21.

Testing

  • On linux/amd64 (Debian trixie containers: cql-ci:go1.27 plus libsqlite3-dev, and golang:1.26 plus libicu-dev and libsqlite3-dev), with Go 1.27.3 and Go 1.26.10, --cpus 4: the four go test commands, taken from the workflow file as written, pass, and each writes a coverage.txt that starts with mode: atomic. Coverage is 65.1%, 64.5%, 65.1% and 65.1% of statements for the default, libsqlite3, full and sqlite_vacuum_full steps, the figures go-acc reported for Go 1.26 in the last develop run.
  • GitHub Actions on this branch: all six jobs pass (run); Go 1.27 on Ubuntu reports 65.1%, 64.6%, 65.1% and 65.1%.

ory/go-acc is archived, and every run installed its latest version with
its own dependencies. For a single package it only runs go test with a
coverage profile, which go test writes itself; with -race the cover
mode is atomic, as go-acc set it.
CovenantSQL builds with Go 1.27, which CI did not test. Go supports
the two latest releases, 1.26 and 1.27, so 1.24 and 1.25 are dropped.
go.mod still requires Go 1.21.
@laodouya
laodouya merged commit b38e872 into develop Nov 6, 2026
12 checks passed
@laodouya
laodouya deleted the ci/go-test-coverage branch November 6, 2026 02:07
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