Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
41 changes: 17 additions & 24 deletions conformance/driver-ct/jco/harness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 };
}
2 changes: 1 addition & 1 deletion conformance/driver-ct/jco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 5 additions & 5 deletions conformance/driver-ct/jco/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 11 additions & 18 deletions conformance/driver-ct/jco/run-node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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`,
);
Expand Down
2 changes: 1 addition & 1 deletion js/componentize/wpt/parity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
10 changes: 5 additions & 5 deletions js/componentize/wpt/parity/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading