Repository navigation
fix: give the naming context to the tests #120 did not see - #148
Merged
Merged
Conversation
`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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
e2e/sdk/helper-tests-checkis red onmain. It shows up on every open PR — including #147, where it is the only one of 131 checks that fails.What fails
go test ./...inhelpers/codegen:TestGenerateDangEntrypointCachePolicy(never,session,ttl)module "Smoke" has no main object: the engine takes none of Smoke for itTestGenerateEntrypointDispatchLoadsModuleCodeiface_classes.ts.gtpl:9:83: … engineIfaceTypeName: module names: no complete naming context to ask the engine aboutWhy nobody's CI caught it
#120 made the generators ask the engine for the names of a module's own declarations, and gave
Namingto every test that builds a generator config. Its branch predates both of these tests:dang_entrypoint_cache_policy_test.goarrived with fix: use GraphQL cache policy enum values in Dang entrypoints #143.TestGenerateEntrypointDispatchLoadsModuleCodearrived with entrypoint: report errors in the engine's function error file #144.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
LoadModuleNamesreturns empty names by design, so the dang entrypoint finds no main object amongtypedef_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 ./...inhelpers/codegen— all packages pass,gofmtclean. The two lines only touch tests, so nothing generated changes.