Repository navigation
chore: remove most export_test.go shims - #32162
ethanndickson merged 4 commits into
Conversation
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb5c919f41
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
642e7ae to
00e43c8
Compare
mafredri
left a comment
There was a problem hiding this comment.
I like the idea of this! But I think there are still some iffy changes in this PR, like the one I commented on here. Would be good to go over with a comb.
But otherwise supporting the direction, good initiative! 👍🏻
3f5a654
Remove 8 of the 13 export_test.go files and move the tests that needed unexported symbols into *_internal_test.go files. Stop the testpackage linter from skipping export_test.go, and state the rule in AGENTS.md and .claude/docs/TESTING.md.
Export Buffer.EpisodeCount and Manager.Started so their tests stay in place, and keep the engineSnapLen and standardWithLocation helpers verbatim.
Test through the exported API where a small change allows it, which removes the engineSnapLen helper that copied engine internals. Keep in *_internal_test.go only the tests that call unexported functions.
3f5a654 to
3f31905
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The tests from #32063 and #32062 are two to three times the size of the code they cover, and a lot of them can't fail for a reason we'd care about. This PR removes those, with no production changes. In `coderd/schedule/cron`, two tests rebuilt the schedule rule a second time to compare against, which was also the only use of `export_test.go`, so that goes too. Most of the rest, in both packages, are table rows that take the same branch as a row that stays. I also dropped a copy of the webhook scheme list and a repeated-request test that belongs at the route. What's left is a row per reject branch, the RFC cases, the regression test for the `Next` hang and the constant-time scan. I replayed each fix commit from the two PRs against the smaller suite, and the pre-fix code still fails a test for every one, other than a fix to the wording of a zone error. One row that stays is changed: the bearer wrong-scheme case used `Basic`, which was only rejected because of where its space lands, so nothing covered the scheme word. It's now `Digest`. #32162 overlaps with this in `cron`. With the shim's users gone it no longer needs to touch that package, so it's now stacked on top of this PR.
Follow-up to #25601, where I missed the other way agents avoid
*_internal_test.go: anexport_test.gofile that re-exports unexported symbols, just so apackage foo_testtest can reach them. There were 13 of these onmain, most recently from #32063.This PR removes 8 of them. Tests of package internals are now
*_internal_test.gofiles, with no changes beyond the package name and the symbols they call.messagepartbufferandagentcontextonly needed one small accessor each, soBuffer.EpisodeCountandManager.Startedare just exported for real, and their tests stay where they were.To stop new ones appearing, the
testpackagelinter no longer skipsexport_test.go(the 5 that are left are excluded by path), andAGENTS.mdand.claude/docs/TESTING.mdnow state the rule.export_test.gois an agent idiom, and imo we should try and get rid of it. So, once this PR is approved, we'll fix up all the remaining ones in a follow-up PR, somehow, and undo the lint exclusion when we do.