Skip to content

docs(agents): unit tests before every push, judged by exit code - #457

Merged
leggetter merged 2 commits into
mainfrom
docs/tests-before-push
Sep 25, 2026
Merged

leggetter merged 2 commits into
mainfrom
docs/tests-before-push

Conversation

@leggetter

Copy link
Copy Markdown
Collaborator

A unit test failed first in CI on #455. It had failed locally too — the output was piped through head, and level=error lines from tests that mock failing API calls pushed the FAIL out of view.

AGENTS.md § Running go test after code changes now states the rule before every push:

  • Unit tests must pass (go test ./..., go vet ./...). A unit test should never fail first in CI.
  • Judge by the exit code, never by filtered output.
  • Run the acceptance tags for what you changed — not the full suite, which CI runs.

It also records the hazard behind the failure: cobra's LocalFlags() and InheritedFlags() merge parents' persistent flags into a command as a side effect, mutating the shared rootCmd for later tests. Walk Flags() and PersistentFlags() instead.

Docs only — outside the acceptance path filter, so it queues no acceptance run.

🤖 Generated with Claude Code

https://claude.ai/code/session_012XtSQ2kfpcRXXqweskgXkH

leggetter and others added 2 commits September 24, 2026 22:38
A unit test failed first in CI on #455. It had failed locally too, but the
output was piped through head and log lines from deliberately failing mock
requests pushed the FAIL out of view.

AGENTS.md now states the rule before every push: unit tests must pass, read
from the exit code rather than filtered output; run the acceptance tags for
what changed, not the full suite, which CI runs. It also records the test
hazard behind that failure: cobra's LocalFlags() and InheritedFlags() mutate
the shared rootCmd, so tests walk Flags() and PersistentFlags().

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012XtSQ2kfpcRXXqweskgXkH
… ones

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012XtSQ2kfpcRXXqweskgXkH
@leggetter
leggetter merged commit 75d4223 into main Sep 25, 2026
9 checks passed
@leggetter
leggetter deleted the docs/tests-before-push branch September 25, 2026 08:25
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