Skip to content

test(runtimes): check that generated modules actually run - #31

Draft
TomChv wants to merge 2 commits into
feat/library-testsfrom
feat/runtime-execution-tests
Draft

test(runtimes): check that generated modules actually run#31
TomChv wants to merge 2 commits into
feat/library-testsfrom
feat/runtime-execution-tests

Conversation

@TomChv

@TomChv TomChv commented Aug 19, 2026

Copy link
Copy Markdown
Member

Every other check inspects what generation writes. None loaded the result — so
the contract the whole move rests on was verified only by hand: sdk/ resolving
as @dagger.io/dagger, the bundle it holds being loadable, the entrypoint
importing the user's classes and registering them. A break there is a module
that generates cleanly and fails at dagger call.

Loading a module is enough to force it. A dagger-module.toml module does no
codegen at call time, and the TypeScript SDK has no ModuleTypes function, so
reading its objects builds the runtime container and executes the generated
entrypoint.

One fixture per runtime, because this is where they stop being interchangeable:
generation differs only in which config file it writes, but node, bun and deno
each execute the entrypoint in a different container with a different
interpreter. Bun had never been run at all — it was dismissed as taking node's
code path, which is true of generation and false of execution.

Staged with withChanges rather than written to disk, which also keeps the
fixtures free of generated output and sidesteps a module's own .gitignore
hiding its generated files from the engine's module context.

Confirmed each check fails when the fixture's object is renamed.

Signed-off-by: Tom Chauveau tom@dagger.io


Stack created with GitHub Stacks CLIGive Feedback 💬

TomChv added 2 commits August 19, 2026 17:41
Every other check inspects what generation writes. None loaded the result — so
the contract the whole move rests on was verified only by hand: sdk/ resolving
as @dagger.io/dagger, the bundle it holds being loadable, the entrypoint
importing the user's classes and registering them. A break there is a module
that generates cleanly and fails at `dagger call`.

Loading a module is enough to force it. A dagger-module.toml module does no
codegen at call time, and the TypeScript SDK has no ModuleTypes function, so
reading its objects builds the runtime container and executes the generated
entrypoint.

One fixture per runtime, because this is where they stop being interchangeable:
generation differs only in which config file it writes, but node, bun and deno
each execute the entrypoint in a different container with a different
interpreter. Bun had never been run at all — it was dismissed as taking node's
code path, which is true of generation and false of execution.

Staged with withChanges rather than written to disk, which also keeps the
fixtures free of generated output and sidesteps a module's own .gitignore
hiding its generated files from the engine's module context.

Confirmed each check fails when the fixture's object is renamed.

Signed-off-by: Tom Chauveau <tom@dagger.io>
Loading a module proves the entrypoint registers its types. This proves the
other half of the dispatcher: that a call reaches the user's code and its
return value comes back.

sdk-sdk's harness already drives a release CLI through the whole user path —
`sdk install`, `module init`, `generate` — so the call is one more command on
the state it leaves behind. What its harness cannot do is init with a
`--runtime` flag: initArgs is private and fixed, and a run's container is not
exposed, so the per-runtime checks still build their own module. A seam there
would be worth proposing upstream.

The function is the default template's baseImageAddress, whose value the
module's constructor sets, so a passing call also means the constructor ran and
its default was applied. Confirmed by changing that default and watching the
check report the new value.

Signed-off-by: Tom Chauveau <tom@dagger.io>
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