From 979ebd240de3ac8f2be0c155187af62e42db80a8 Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Fri, 7 Aug 2026 15:46:49 -0400 Subject: [PATCH] Bump component-test to eabd159; slim the jco legs onto the upstream loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pin moves via pins bump. harness.mjs's runSuite becomes a thin adapter over the upstream runSuiteJsonl (polymorph-test#70) — the case loop, fresh-instance policy, envelope, and terminator live upstream; the local wrapper keeps this repo's newInstance/coreBytes signature for both legs, and stays browser-loadable (the page runs it unchanged, which also exercises the upstream loop in Chromium). run-node.mjs drops its local core loading and results-file writing for the ./node-runner helpers. Verified: conformance-ct::all green including the browser leg (4 targets, 220 results, matrix unchanged), check-js, wpt::parity. --- .github/workflows/ci.yml | 4 +-- Cargo.lock | 14 ++++---- Cargo.toml | 4 +-- conformance/driver-ct/jco/harness.mjs | 41 ++++++++++------------- conformance/driver-ct/jco/package.json | 2 +- conformance/driver-ct/jco/pnpm-lock.yaml | 10 +++--- conformance/driver-ct/jco/run-node.mjs | 29 ++++++---------- js/componentize/wpt/parity/package.json | 2 +- js/componentize/wpt/parity/pnpm-lock.yaml | 10 +++--- 9 files changed, 51 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe2b637..12c1ff1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: # Owns the rev derivation, the rev-keyed tools cache, the # install, and the pins gate; the justfile's _ct-tools # recognizes the stamped install and does not repeat it. - uses: polymorph-components/polymorph-test/actions/setup@76c094576076284c1a7d0ea1b7bb724e9e7384a5 + uses: polymorph-components/polymorph-test/actions/setup@eabd159de34e38a6f2f32204ceb52392555f32d8 with: tools: component-test-cli js-locks: | @@ -130,7 +130,7 @@ jobs: # against the pin. - name: Publish the conformance matrix if: always() && hashFiles('conformance/driver-ct/results/*.jsonl') != '' - uses: polymorph-components/polymorph-test/actions/aggregate@76c094576076284c1a7d0ea1b7bb724e9e7384a5 + uses: polymorph-components/polymorph-test/actions/aggregate@eabd159de34e38a6f2f32204ceb52392555f32d8 with: lock: conformance/guest-ct/tests.lock manifest: conformance/driver-ct/targets.toml diff --git a/Cargo.lock b/Cargo.lock index 3f5db0d..025eab7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,7 +180,7 @@ dependencies = [ [[package]] name = "component-test-core" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=eabd159de34e38a6f2f32204ceb52392555f32d8#eabd159de34e38a6f2f32204ceb52392555f32d8" dependencies = [ "arcstr", "serde", @@ -189,7 +189,7 @@ dependencies = [ [[package]] name = "component-test-formats" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=eabd159de34e38a6f2f32204ceb52392555f32d8#eabd159de34e38a6f2f32204ceb52392555f32d8" dependencies = [ "anyhow", "component-test-core", @@ -204,7 +204,7 @@ dependencies = [ [[package]] name = "component-test-results" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=eabd159de34e38a6f2f32204ceb52392555f32d8#eabd159de34e38a6f2f32204ceb52392555f32d8" dependencies = [ "anyhow", "component-test-core", @@ -215,7 +215,7 @@ dependencies = [ [[package]] name = "component-test-runner" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=eabd159de34e38a6f2f32204ceb52392555f32d8#eabd159de34e38a6f2f32204ceb52392555f32d8" dependencies = [ "anyhow", "component-test-core", @@ -231,7 +231,7 @@ dependencies = [ [[package]] name = "component-test-sdk" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=eabd159de34e38a6f2f32204ceb52392555f32d8#eabd159de34e38a6f2f32204ceb52392555f32d8" dependencies = [ "component-test-core", "component-test-sdk-macro", @@ -243,7 +243,7 @@ dependencies = [ [[package]] name = "component-test-sdk-macro" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=eabd159de34e38a6f2f32204ceb52392555f32d8#eabd159de34e38a6f2f32204ceb52392555f32d8" dependencies = [ "component-test-core", "proc-macro2", @@ -1814,7 +1814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.3", + "getrandom 0.3.4", "once_cell", "rustix", "windows-sys 0.61.2", diff --git a/Cargo.toml b/Cargo.toml index 276bbdb..bb5b087 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,8 +30,8 @@ default-members = [ # `cargo update component-test-sdk component-test-runner` and # `pnpm --dir conformance/driver-ct/jco install`; the _ct-tools pins # gate and the CI ref guard fail on skew. -component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "76c094576076284c1a7d0ea1b7bb724e9e7384a5" } -component-test-runner = { git = "https://github.com/polymorph-components/polymorph-test", rev = "76c094576076284c1a7d0ea1b7bb724e9e7384a5" } +component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "eabd159de34e38a6f2f32204ceb52392555f32d8" } +component-test-runner = { git = "https://github.com/polymorph-components/polymorph-test", rev = "eabd159de34e38a6f2f32204ceb52392555f32d8" } anyhow = "1" bytes = "1" futures = "0.3" diff --git a/conformance/driver-ct/jco/harness.mjs b/conformance/driver-ct/jco/harness.mjs index c4363e6..42a6641 100644 --- a/conformance/driver-ct/jco/harness.mjs +++ b/conformance/driver-ct/jco/harness.mjs @@ -18,8 +18,7 @@ // per-endpoint handshake serialization (the incumbent driver's // HANDSHAKE_BLOCKING workaround) entirely. -import { envelope, inventoryLookup, runCases } from "@polymorph/component-test-js/harness"; -import { Context } from "@polymorph/component-test-js/context"; +import { inventoryLookup, runSuiteJsonl } from "@polymorph/component-test-js/harness"; import { bindImports as bindCoreImports, envInterface, @@ -49,31 +48,25 @@ export function bindImports({ connections, env, cli, clocks, io }) { export { envInterface }; /** - * Run the whole suite through the upstream case loop. `newInstance()` - * must return a fresh instantiated suite (exports object) — census and - * every case each get their own; `coreBytes` are the transpiled core - * wasm bytes carrying the tag inventory; `emit(line)` receives each - * JSONL line. Returns `{ total, failed }`. + * Run the whole suite through the upstream case loop + * (`runSuiteJsonl`). `newInstance()` must return a fresh instantiated + * suite (exports object) — census and every case each get their own; + * `coreBytes` are the transpiled core wasm bytes carrying the tag + * inventory; `emit(line)` receives each JSONL line. Returns + * `{ total, failed }`. */ export async function runSuite({ newInstance, coreBytes, target, suiteName, emit, log }) { - emit(JSON.stringify(envelope(target, suiteName))); - const tagsOf = inventoryLookup(coreBytes); - const census = await (await newInstance()).tests.all(); - const counts = await runCases({ - cases: census, - Context, - tagsOf, - missing: [], - emit: (event) => { - emit(JSON.stringify(event)); - log?.(`${event.case} … ${event.status}`); - }, + const counts = await runSuiteJsonl({ + // The suites export the bare `tests` spelling; this module also + // runs in the browser page, where the node-runner helpers cannot + // load. + newTests: async () => (await newInstance()).tests, + tagsOf: inventoryLookup(coreBytes), + target, + suiteName, + emit, + log, caseTimeoutMs: CASE_TIMEOUT_MS, - freshCases: async () => (await newInstance()).tests.all(), }); - if (counts.total === 0) { - throw new Error("suite enumerated zero cases (empty selection is a run error)"); - } - emit(JSON.stringify({ "segment-end": true })); return { total: counts.total, failed: counts.failed }; } diff --git a/conformance/driver-ct/jco/package.json b/conformance/driver-ct/jco/package.json index 9c19e05..3c08e01 100644 --- a/conformance/driver-ct/jco/package.json +++ b/conformance/driver-ct/jco/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@bytecodealliance/jco-transpile": "https://github.com/lann/jco/releases/download/jco-transpile-0.6.2-fa6990d/bytecodealliance-jco-transpile-0.6.2.tgz", "@bytecodealliance/preview2-shim": "^0.17.2", - "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#76c094576076284c1a7d0ea1b7bb724e9e7384a5", + "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#eabd159de34e38a6f2f32204ceb52392555f32d8", "playwright-core": "^1.61.1" }, "engines": { diff --git a/conformance/driver-ct/jco/pnpm-lock.yaml b/conformance/driver-ct/jco/pnpm-lock.yaml index f748f28..0fa6ebb 100644 --- a/conformance/driver-ct/jco/pnpm-lock.yaml +++ b/conformance/driver-ct/jco/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^0.17.2 version: 0.17.9 '@polymorph/component-test-js': - specifier: github:polymorph-components/polymorph-test#76c094576076284c1a7d0ea1b7bb724e9e7384a5 - version: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/76c094576076284c1a7d0ea1b7bb724e9e7384a5 + specifier: github:polymorph-components/polymorph-test#eabd159de34e38a6f2f32204ceb52392555f32d8 + version: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/eabd159de34e38a6f2f32204ceb52392555f32d8 playwright-core: specifier: ^1.61.1 version: 1.62.1 @@ -182,8 +182,8 @@ packages: cpu: [x64] os: [win32] - '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/76c094576076284c1a7d0ea1b7bb724e9e7384a5': - resolution: {gitHosted: true, integrity: sha512-e1ojI6hXZB3RQBrQdxob0BNg0+S3sVAKAOykKs9iqfy3qXVWFsQa+nXJ+px1bXXGB7TBSauJygWin9ANtNZAHw==, tarball: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/76c094576076284c1a7d0ea1b7bb724e9e7384a5} + '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/eabd159de34e38a6f2f32204ceb52392555f32d8': + resolution: {gitHosted: true, integrity: sha512-nMkzZexPzwJooKIcACOoMzw7PkOZsTSGBZXq/LOxW7AI/Sn0Z5oJWEelxYxaIu/MxDqF79p785KsmExsrWjuoA==, tarball: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/eabd159de34e38a6f2f32204ceb52392555f32d8} version: 0.2.0 hasBin: true @@ -312,7 +312,7 @@ snapshots: '@oxc-minify/binding-win32-x64-msvc@0.136.0': optional: true - '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/76c094576076284c1a7d0ea1b7bb724e9e7384a5': {} + '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/eabd159de34e38a6f2f32204ceb52392555f32d8': {} '@tybys/wasm-util@0.10.3': dependencies: diff --git a/conformance/driver-ct/jco/run-node.mjs b/conformance/driver-ct/jco/run-node.mjs index 9ae56d0..b569b72 100644 --- a/conformance/driver-ct/jco/run-node.mjs +++ b/conformance/driver-ct/jco/run-node.mjs @@ -5,13 +5,18 @@ // // jco's async ABI needs JSPI: Node 24+ with --experimental-wasm-jspi // (the package's `run:node` script supplies it). -import { access, mkdir, readFile, readdir, writeFile } from "node:fs/promises"; +import { access } from "node:fs/promises"; import { dirname, join, resolve } from "node:path"; import { fileURLToPath } from "node:url"; import { parseArgs } from "node:util"; import { cli, clocks, io } from "@bytecodealliance/preview2-shim"; +import { + loadCoreModules, + writeResultsFile, +} from "@polymorph/component-test-js/node-runner"; + import { bindImports, runSuite } from "./harness.mjs"; import { requireNode24, spawnEchod, unreachableUrl } from "../../server/echod.mjs"; @@ -46,20 +51,6 @@ const { values } = parseArgs({ }, }); -async function loadCoreModules(generatedDir) { - const modules = new Map(); - const coreBytes = []; - for (const name of await readdir(generatedDir)) { - if (name.endsWith(".wasm")) { - const bytes = new Uint8Array(await readFile(join(generatedDir, name))); - coreBytes.push(bytes); - modules.set(name, await WebAssembly.compile(bytes)); - } - } - return { modules, coreBytes }; -} - - async function main() { const generatedDir = values.generated; try { @@ -103,9 +94,11 @@ async function main() { if (owned) await owned.shutdown(); } - await mkdir(values.out, { recursive: true }); - const outPath = join(values.out, `${values.target}.jsonl`); - await writeFile(outPath, `${lines.join("\n")}\n`); + const outPath = await writeResultsFile({ + dir: values.out, + target: values.target, + lines, + }); process.stderr.write( `wrote ${outPath} (${summary.total} cases, ${summary.failed} failed)\n`, ); diff --git a/js/componentize/wpt/parity/package.json b/js/componentize/wpt/parity/package.json index e86cb79..13a5809 100644 --- a/js/componentize/wpt/parity/package.json +++ b/js/componentize/wpt/parity/package.json @@ -19,7 +19,7 @@ "devDependencies": { "@bytecodealliance/jco-transpile": "https://github.com/lann/jco/releases/download/jco-transpile-0.6.2-fa6990d/bytecodealliance-jco-transpile-0.6.2.tgz", "@bytecodealliance/preview2-shim": "^0.19.0", - "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#76c094576076284c1a7d0ea1b7bb724e9e7384a5", + "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#eabd159de34e38a6f2f32204ceb52392555f32d8", "playwright-core": "^1.61.1" } } diff --git a/js/componentize/wpt/parity/pnpm-lock.yaml b/js/componentize/wpt/parity/pnpm-lock.yaml index aab3f37..5f0800c 100644 --- a/js/componentize/wpt/parity/pnpm-lock.yaml +++ b/js/componentize/wpt/parity/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^0.19.0 version: 0.19.0 '@polymorph/component-test-js': - specifier: github:polymorph-components/polymorph-test#76c094576076284c1a7d0ea1b7bb724e9e7384a5 - version: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/76c094576076284c1a7d0ea1b7bb724e9e7384a5 + specifier: github:polymorph-components/polymorph-test#eabd159de34e38a6f2f32204ceb52392555f32d8 + version: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/eabd159de34e38a6f2f32204ceb52392555f32d8 playwright-core: specifier: ^1.61.1 version: 1.62.1 @@ -179,8 +179,8 @@ packages: cpu: [x64] os: [win32] - '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/76c094576076284c1a7d0ea1b7bb724e9e7384a5': - resolution: {gitHosted: true, integrity: sha512-e1ojI6hXZB3RQBrQdxob0BNg0+S3sVAKAOykKs9iqfy3qXVWFsQa+nXJ+px1bXXGB7TBSauJygWin9ANtNZAHw==, tarball: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/76c094576076284c1a7d0ea1b7bb724e9e7384a5} + '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/eabd159de34e38a6f2f32204ceb52392555f32d8': + resolution: {gitHosted: true, tarball: https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/eabd159de34e38a6f2f32204ceb52392555f32d8} version: 0.2.0 hasBin: true @@ -307,7 +307,7 @@ snapshots: '@oxc-minify/binding-win32-x64-msvc@0.136.0': optional: true - '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/76c094576076284c1a7d0ea1b7bb724e9e7384a5': {} + '@polymorph/component-test-js@https://codeload.github.com/polymorph-components/polymorph-test/tar.gz/eabd159de34e38a6f2f32204ceb52392555f32d8': {} '@tybys/wasm-util@0.10.3': dependencies: