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
46 changes: 13 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,14 @@ jobs:
shared-key: conformance
cache-all-crates: true

- name: Compute the component-test rev
# The single source of truth for the pin is Cargo.lock (the git
# dependency's rev); the tools cache below keys on it. Anchored
# on the crate name, not the repository URL, like the
# conformance-ct::_ct-tools extraction.
id: ct-rev
run: |
rev=$(grep -m1 -A2 '^name = "component-test-sdk"' Cargo.lock | grep -oE '[0-9a-f]{40}' | head -1)
test -n "$rev"
echo "rev=$rev" >> "$GITHUB_OUTPUT"

- name: Cache component-test tools
# The cargo-installed component-test CLI + generic runner
# binaries (conformance-ct::_ct-tools installs them at exactly
# the Cargo.lock-pinned rev and reuses on a stamp match). The
# binaries are a pure function of that rev and the toolchain, so
# the key never needs invalidating beyond those.
uses: actions/cache@v4
- name: Install the component-test tools at the pinned revision
# Owns the rev derivation, the rev-keyed tools cache, the
# install, and the pins gate; conformance-ct::_ct-tools
# recognizes the stamped install and does not repeat it.
uses: polymorph-components/polymorph-test/actions/setup@76c094576076284c1a7d0ea1b7bb724e9e7384a5
with:
path: target/ct-tools
key: component-test-tools-${{ runner.os }}-${{ steps.ct-rev.outputs.rev }}-${{ hashFiles('rust-toolchain.toml') }}
js-locks: |
conformance/driver-ct/jco/package-lock.json

- name: Install Node 24
uses: actions/setup-node@v4
Expand Down Expand Up @@ -167,20 +154,11 @@ jobs:
# gated the same aggregates; these re-run them through
# component-test's composite action for the job summary and
# finding annotations, with the prebuilt CLI so aggregation
# semantics cannot skew from the pin. `uses:` cannot interpolate,
# so the refs are literal revs; the guard keeps them on the
# Cargo.lock pin.
- name: Check the aggregate action refs match the pin
if: always()
run: |
if grep -E 'polymorph-test/actions/aggregate@[0-9a-f]{40}' .github/workflows/ci.yml | grep -qv "@${{ steps.ct-rev.outputs.rev }}"; then
echo "aggregate action ref skew: not at the Cargo.lock rev ${{ steps.ct-rev.outputs.rev }}" >&2
exit 1
fi

# semantics cannot skew from the pin. The action's cargo-lock
# input polices the `uses:` refs against the pin.
- name: Publish the conformance matrix
if: always() && hashFiles('conformance/driver-ct/results/*.jsonl') != ''
uses: polymorph-components/polymorph-test/actions/aggregate@824d100349dc7804c9bf1723d9b1ba0ed40fa940
uses: polymorph-components/polymorph-test/actions/aggregate@76c094576076284c1a7d0ea1b7bb724e9e7384a5
with:
lock: conformance/guest-ct/tests.lock
manifest: conformance/driver-ct/targets.toml
Expand All @@ -191,10 +169,11 @@ jobs:
jco-browser=conformance/driver-ct/results/jco-browser.jsonl
summary-title: Conformance matrix
cli: target/ct-tools/bin/component-test
cargo-lock: Cargo.lock

- name: Publish the signing conformance matrix
if: always() && hashFiles('conformance/driver-ct/results/*.jsonl') != ''
uses: polymorph-components/polymorph-test/actions/aggregate@824d100349dc7804c9bf1723d9b1ba0ed40fa940
uses: polymorph-components/polymorph-test/actions/aggregate@76c094576076284c1a7d0ea1b7bb724e9e7384a5
with:
lock: conformance/signing-guest-ct/tests.lock
manifest: conformance/driver-ct/targets-signing.toml
Expand All @@ -204,6 +183,7 @@ jobs:
jco-browser=conformance/driver-ct/results/jco-browser-signing.jsonl
summary-title: Signing conformance matrix
cli: target/ct-tools/bin/component-test
cargo-lock: Cargo.lock

- name: Upload the conformance results
# Feeds the Pages viewer (the latest main run's results pane)
Expand Down
10 changes: 5 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ skip the npm install). The polymorph:test stack is a git dependency
pinned by rev in the root `Cargo.toml` and enforced by `Cargo.lock`;
cargo fetches it, and `conformance-ct::_ct-tools` cargo-installs the
`component-test`/`ct-runner` binaries at the same locked rev. To bump
the pin: edit the rev in `Cargo.toml`, run `cargo update -p
component-test-sdk -p component-test-runner`, and commit the lock diff;
the npm pin in `conformance/driver-ct/jco` and the `actions/aggregate`
refs in `.github/workflows/ci.yml` move with it (the `_ct-tools` pins
gate and the CI ref guard fail on skew).
the pin: `component-test pins bump <rev> --cargo-toml Cargo.toml
--package-json conformance/driver-ct/jco/package.json --workflow
.github/workflows/ci.yml`, then the follow-ups it prints (`cargo
update`, `npm install`); the `_ct-tools` pins gate and the actions'
own ref checks fail on skew.
To develop against a local component-test checkout, add a temporary
override to the root `Cargo.toml` (do not commit it):

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 @@ -26,8 +26,8 @@ resolver = "2"
# override — see AGENTS.md "Build & run". Publishing component-test
# to a registry retires this arrangement.
[workspace.dependencies]
component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "824d100349dc7804c9bf1723d9b1ba0ed40fa940" }
component-test-runner = { git = "https://github.com/polymorph-components/polymorph-test", rev = "824d100349dc7804c9bf1723d9b1ba0ed40fa940" }
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" }

# The mutation run's profile (`just mutants`): dependencies optimized —
# wasmtime and the RustCrypto cores are compiled once, at baseline, and make
Expand Down
11 changes: 7 additions & 4 deletions conformance/driver-ct/jco/package-lock.json

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

6 changes: 3 additions & 3 deletions conformance/driver-ct/jco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"type": "module",
"description": "jco drivers (Node + headless browser) for the ported conformance suites: transpiles conformance-guest-ct and conformance-signing-guest-ct against the browser-first host (js/jco/webcrypto.js) plus a JS test-context provider, and runs them with mark scheduling under Node (runner.mjs) or headless Chromium (run-browser.mjs).",
"scripts": {
"transpile": "node ../../../scripts/jco-transpile.mjs transpile ../../../target/wasm32-wasip2/release/conformance_guest_ct.wasm --name conformance-guest-ct --async-mode jspi --map 'polymorph:webcrypto/*@0.1.0=../../../../js/jco/webcrypto.js#*' --map 'polymorph:test/test-context@0.1.0=../../context.js' --map 'wasi:cli/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' --map 'wasi:clocks/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js#*' --map 'wasi:io/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js#*' --map 'wasi:random/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js#*' --map 'wasi:filesystem/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js#*' -o generated",
"transpile:signing": "node ../../../scripts/jco-transpile.mjs transpile ../../../target/wasm32-wasip2/release/conformance_signing_guest_ct.wasm --name conformance-signing-guest-ct --async-mode jspi --map 'polymorph:webcrypto/*@0.1.0=../../../../js/jco/webcrypto.js#*' --map 'polymorph:test/test-context@0.1.0=../../context.js' --map 'wasi:cli/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' --map 'wasi:clocks/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js#*' --map 'wasi:io/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js#*' --map 'wasi:random/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js#*' --map 'wasi:filesystem/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js#*' -o generated",
"transpile": "component-test-jco-transpile transpile ../../../target/wasm32-wasip2/release/conformance_guest_ct.wasm --name conformance-guest-ct --async-mode jspi --map 'polymorph:webcrypto/*@0.1.0=../../../../js/jco/webcrypto.js#*' --map 'polymorph:test/test-context@0.1.0=../../context.js' --map 'wasi:cli/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' --map 'wasi:clocks/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js#*' --map 'wasi:io/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js#*' --map 'wasi:random/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js#*' --map 'wasi:filesystem/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js#*' -o generated",
"transpile:signing": "component-test-jco-transpile transpile ../../../target/wasm32-wasip2/release/conformance_signing_guest_ct.wasm --name conformance-signing-guest-ct --async-mode jspi --map 'polymorph:webcrypto/*@0.1.0=../../../../js/jco/webcrypto.js#*' --map 'polymorph:test/test-context@0.1.0=../../context.js' --map 'wasi:cli/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' --map 'wasi:clocks/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js#*' --map 'wasi:io/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js#*' --map 'wasi:random/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js#*' --map 'wasi:filesystem/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js#*' -o generated",
"run": "node --experimental-wasm-jspi runner.mjs",
"run:browser": "node run-browser.mjs"
},
"dependencies": {
"@bytecodealliance/jco-transpile": "^0.5.2",
"@bytecodealliance/preview2-shim": "^0.17.4",
"@polymorph/component-test-js": "github:polymorph-components/polymorph-test#824d100349dc7804c9bf1723d9b1ba0ed40fa940",
"@polymorph/component-test-js": "github:polymorph-components/polymorph-test#76c094576076284c1a7d0ea1b7bb724e9e7384a5",
"playwright-core": "^1.61.1"
}
}
2 changes: 1 addition & 1 deletion conformance/driver-ct/jco/run-browser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async function main() {
const run = outcome[suite];
if (!run) throw new Error(`the page reported no run for suite ${suite}`);
const lines = [
JSON.stringify(envelope(values.target, suite.replaceAll("-", "_"))), // lockfile identity: wasm file stem
JSON.stringify(envelope(values.target, suite)), // lockfile identity: wasm file stem
...run.events.map((event) => JSON.stringify(event)),
'{"segment-end":true}',
];
Expand Down
2 changes: 1 addition & 1 deletion conformance/driver-ct/jco/runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if (jsonl) {
// The lockfile names the suite by its wasm file stem (underscores);
// the transpile name is hyphenated. Envelope with the lockfile identity
// so the aggregate's cross-check stays quiet.
const lines = [JSON.stringify(envelope(values.target, suite.replaceAll("-", "_")))];
const lines = [JSON.stringify(envelope(values.target, suite))];
for (const { event } of rows) lines.push(JSON.stringify(event));
lines.push('{"segment-end":true}');
console.log(lines.join("\n"));
Expand Down
2 changes: 1 addition & 1 deletion conformance/driver-ct/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ _viewer-prepared: _jco-prepared
--target wasm32-wasip2 --release -p viewer-aggregate
cd jco
node stage-viewer.mjs "$src"
node ../../../scripts/jco-transpile.mjs transpile \
node_modules/.bin/component-test-jco-transpile transpile \
"$src/target/wasm32-wasip2/release/viewer_aggregate.wasm" \
--name viewer-aggregate \
--map 'wasi:cli/*=../../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' \
Expand Down
Loading