Skip to content

fix: give the naming context to the tests #120 did not see - #148

Merged
TomChv merged 1 commit into
mainfrom
fix-codegen-naming-tests
Nov 25, 2026
Merged

TomChv merged 1 commit into
mainfrom
fix-codegen-naming-tests

Conversation

@TomChv

@TomChv TomChv commented Nov 25, 2026

Copy link
Copy Markdown
Member

e2e/sdk/helper-tests-check is red on main. It shows up on every open PR — including #147, where it is the only one of 131 checks that fails.

What fails

go test ./... in helpers/codegen:

Test Error
TestGenerateDangEntrypointCachePolicy (never, session, ttl) module "Smoke" has no main object: the engine takes none of Smoke for it
TestGenerateEntrypointDispatchLoadsModuleCode iface_classes.ts.gtpl:9:83: … engineIfaceTypeName: module names: no complete naming context to ask the engine about

Why nobody's CI caught it

#120 made the generators ask the engine for the names of a module's own declarations, and gave Naming to every test that builds a generator config. Its branch predates both of these tests:

Both merged after #120's CI ran. Git merged all three cleanly — different files, or different hunks of one — so the combination was never tested until the next PR landed on top of it. Not a regression in #120's code: without a naming context LoadModuleNames returns empty names by design, so the dang entrypoint finds no main object among typedef_smoke.json's objects, and the dispatcher cannot name the fixture's own interface.

The fix

One line each: Naming: smokeNaming(), which is what every other test on that fixture already passes.

Verification

go test ./... in helpers/codegen — all packages pass, gofmt clean. The two lines only touch tests, so nothing generated changes.

`e2e/sdk/helper-tests-check` is red on main: `go test ./...` in
helpers/codegen fails TestGenerateDangEntrypointCachePolicy (3 subtests)
and TestGenerateEntrypointDispatchLoadsModuleCode.

Neither is a regression in #120's code, and neither PR could have caught
it. #120 made every generator that renders a module's own declarations
ask the engine for their names, and added `Naming` to each test that
builds a generator config. Its branch predates both of these tests:

- dang_entrypoint_cache_policy_test.go arrived with #143.
- TestGenerateEntrypointDispatchLoadsModuleCode arrived with #144.

Both merged after #120's CI ran, git merged all three cleanly, and the
combination was never tested. Without a naming context the dang
entrypoint finds no main object among typedef_smoke.json's objects, and
the dispatcher cannot name the fixture's own interface.

Both now use `smokeNaming()`, as every other test on that fixture does.

Signed-off-by: Tom Chauveau <[email protected]>
@TomChv
TomChv merged commit c691375 into main Nov 25, 2026
6 checks passed
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