Skip to content

fix: make export-stripped tests edition-aware so CI can go green - #28

Open
akindejuh wants to merge 1 commit into
mainfrom
fix/public-export-test-drift
Open

fix: make export-stripped tests edition-aware so CI can go green#28
akindejuh wants to merge 1 commit into
mainfrom
fix/public-export-test-drift

Conversation

@akindejuh

Copy link
Copy Markdown

Why

CI has failed on every push to main since v2.7.194 (Jul 1) — v2.7.194, 196, 197, 200, 203 are all red. Both failures are the same shape: a test hardcodes an artifact that the public-export script strips, so the assertion can only ever pass in the platform build.

This is pure test drift. No production code changes.

TestNoBareGoFuncInWorkers

Reads a fixed list of ten worker files and calls t.Fatal on a read error. Four are platform-only and absent here:

auth.go cron.go rbac.go jobs.go flows.go feedback_ui.go   present
backup_worker.go marketing_drips.go quarantine.go
builder_uploads.go                                         ABSENT

So the test died on the first missing file having scanned nothing — the bare-go func guard hasn't actually run in this edition for months.

The invariant it defends is "no bare go func in a worker file", not "every file in this list exists". Absent files are now skipped and the six that ship are scanned. A scanned == 0 guard keeps it from passing vacuously if the list ever drifts entirely out of date.

TestAgentDocs_TopicsList

Asserted an exact [build deploy] pair, but AgentDocsTopics() reads embedded docs/agent/*.md and deploy.md is the cloud-edition ship guide — not in this tree.

Rather than weaken the check to nothing, it now asserts what holds in every edition: build is always present, every topic present was deliberately declared, and the list is sorted. An undeclared new topic still fails, which was the original intent ("a new topic is a deliberate act").

Verification

go vet  -tags sqlite_fts5 ./...   clean
go test -tags sqlite_fts5 ./...   455 passed, 0 failed

First green run on this tree since July.

Note

#27 is red for exactly these two failures and nothing else. Merging this first, then rebasing #27, should take both green.

🤖 Generated with Claude Code

CI has failed on every push to main since v2.7.194 (Jul 1). Both failures
are the same shape: a test hardcodes an artifact that the public-export
script strips, so the assertion can only pass in the platform build.

TestNoBareGoFuncInWorkers reads a fixed list of worker files and calls
t.Fatal on a read error. Four of the ten (backup_worker.go,
marketing_drips.go, quarantine.go, builder_uploads.go) are platform-only,
so the test died on the first missing file without scanning anything. The
invariant it defends is "no bare go func in a worker file", not "every
file in this list exists" - so absent files are now skipped and the six
that do ship are still scanned. A scanned==0 guard keeps the test from
passing vacuously if the list ever drifts entirely out of date.

TestAgentDocs_TopicsList asserted an exact [build deploy] pair, but
deploy.md is the cloud-edition ship guide and is not embedded in the
framework build. Rather than weaken the check to nothing, it now asserts
the invariants that hold in every edition: build is always present, every
topic present is one that was deliberately declared, and the list is
sorted. An undeclared new topic still fails, which was the point.

No production code changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@akindejuh akindejuh self-assigned this Aug 27, 2026
@akindejuh akindejuh added the bug Something isn't working label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant