Repository navigation
jco legs: consume the upstream JS runner core (@lann/component-test-js) - #24
Merged
Merged
Conversation
The local pre-facade harness carried ~160 lines of component-test protocol implementation — the results envelope, the case loop, the thrown-payload verdict mapping, the test-context provider — that any other consumer would have to copy and keep in sync with the results schema by hand. Upstream promoted that machinery into the @lann/component-test-js facade (lann/component-test 0c8cfd5) and, for the two gaps these legs need, grew runCases per-case fresh instances and a per-case wall bound (polymorph-components/polymorph-test#50, merged as the pinned rev). The local copy is deleted; harness.mjs is now thin glue: bindImports (SUT wiring, config environment, the dual key spellings) and a runSuite that feeds the upstream loop. What the legs gain beyond deduplication: the upstream loop mark-schedules against the tag inventory read from the transpiled core wasm, so the jco legs now carry the same inventory-drift check the wasmtime runner applies (a case the tags section does not cover fails the run as unsound). The suite is untagged and targets.toml declares no features, so `missing` is always empty and every case runs, exactly as before. Leg specifics: - run-node keeps the compiled-module map but retains the raw bytes for the inventory scan. - run-browser resolves the bare @lann/component-test-js specifiers through a page import map onto /ct/-served facade files (resolved from the installed package via import.meta.resolve), and compiles from fetched bytes instead of compileStreaming so the same bytes feed the inventory. - Event-shape deltas against the deleted local loop, both aligning the jco legs with the Rust runner: diagnostics attach only when non-empty, diagnostics-complete appears only where incompleteness is possible, and the envelope drops "scheduling":"none" because the loop now schedules. Neither jsonl stream is committed; the matrix is byte-identical. One rev everywhere: the npm pin, both cargo entries, and the CLI install all move to polymorph-components/polymorph-test@135a395 together (the root Cargo.toml comment is the bump checklist). Verification: full just ci green (3 targets x 52 cases, 0 failing, committed matrix byte-identical), including the real headless-Chromium leg through the import map.
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.
Stacked on #23 (git-sourced cargo deps); completes the dependency policy for JS. Depends on polymorph-components/polymorph-test#52 (the
runCasesgating options), currently pinned at its head rev135a395— if that PR rebase-merges, the three pins here bump to the post-merge SHA (rootCargo.tomlcomment is the checklist).The local pre-facade harness (~160 lines of component-test protocol: results envelope, case loop, verdict mapping, test-context provider) is deleted in favor of
@lann/component-test-jsas agithub:lann/component-test#<rev>npm git dep — one harness for every runner, per polymorph-components/polymorph-test#5.harness.mjsis now thin glue:bindImports+ arunSuitethat feeds the upstream loop withfreshCases(instance-per-case, matching the wasmtime leg) andcaseTimeoutMs(60s, matching--case-timeout).New capability, free with the facade: the jco legs now run the same tag-inventory drift check the wasmtime runner applies, read from the transpiled core wasm custom sections (verified the section survives jco's instantiation-mode transpile). Untagged suite + no declared features = every case runs, exactly as before.
The browser leg maps the bare specifiers through a page import map onto served facade files — same source runs in Node and Chromium unchanged.
Event-shape deltas (uncommitted jsonl only; matrix byte-identical): diagnostics attach only when non-empty,
diagnostics-completeonly where incompleteness is possible, envelope drops"scheduling":"none"since the loop now schedules — all three aligning jco output with the Rust runner's.Verification: full
just cigreen — 3 targets x 52 cases, 0 failing, committed matrix byte-identical, headless-Chromium leg included.