From 1b90e60aeb138824926167638c2defaf38832e92 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Sat, 19 Sep 2026 16:20:36 +1000 Subject: [PATCH] Run go test once per module in pre-commit The go-unit-tests hook caps every package at 30s and re-runs the whole module once per file batch, so the git-fixture tests in cmd/agentws timed out as soon as they grew. - Replace go-unit-tests with a module-level `go test ./...` local hook --- .pre-commit-config.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c270a6f..2e8a9a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,10 +13,11 @@ repos: rev: v0.5.1 hooks: - id: go-fmt - - id: go-unit-tests - # go-vet at the module level (dnephin's go-vet runs at repo root, which has no - # .go files here since both tools live under cmd/). The CI pre-commit image + # go vet and go test at the module level (dnephin's run at repo root, which has + # no .go files here since both tools live under cmd/, and its go-unit-tests + # caps every package at 30s and re-runs the whole module once per file batch — + # the git-fixture tests outgrew both). The CI pre-commit image # (almalinux9-gobuilder) has go installed. - repo: local hooks: @@ -26,3 +27,9 @@ repos: language: system types: [go] pass_filenames: false + - id: go-test-mod + name: go test (module) + entry: go test ./... + language: system + types: [go] + pass_filenames: false