Skip to content

New test harness#127

Merged
aarne merged 4 commits intounify_wiresfrom
new_test_harness
Mar 13, 2026
Merged

New test harness#127
aarne merged 4 commits intounify_wiresfrom
new_test_harness

Conversation

@aarne
Copy link
Contributor

@aarne aarne commented Mar 13, 2026

No description provided.

aarne and others added 4 commits March 11, 2026 08:29
…#126)

* Initial plan

* Migrate fallback-bug.test.ts from forEachEngine to regressionTest

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Migrate chained.test.ts from forEachEngine to regressionTest

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Migrate string-interpolation.test.ts and interpolation-universal.test.ts to regressionTest

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Migrate prototype-pollution.test.ts from forEachEngine

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Migrate ternary.test.ts from forEachEngine to regressionTest (partial - 2 trace assertions need engine-specific handling)

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Fix ternary refFallback trace assertion: runtime lazy vs compiler eager

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* refactor: migrate expressions.test.ts from forEachEngine to regressionTest

Migrated the following test groups to the regressionTest harness:
- expressions: execution (arithmetic, comparisons, tool source, chained)
- expressions: operator precedence
- boolean logic: not prefix
- parenthesized arithmetic
- safe flag propagation in expressions (with allowDowngrade)
- safe navigation with sync tool (with allowDowngrade)

Tests that cannot be migrated due to compiler limitations remain as
forEachEngine blocks:
- String literal comparison (serializer strips quotes)
- Array mapping with expressions (serializer bug)
- catch error fallback (compiler doesn't downgrade)
- and/or boolean logic (compiler generates broken __and/__or)
- Parenthesized boolean expressions (contain and/or)
- condAnd/condOr without safe navigation
- Safe flag on right operand of and/or

Side-effect tests (short-circuit behavior) moved to
test/legacy/expressions.test.ts per migration guidelines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: migrate force-wire tests to regressionTest harness

- Tests 1,2,4,5 migrated to regressionTest with test.multitool
- Tests 3 (timing) and 6 (runtime-skip) moved to legacy/force-wire.test.ts
- All 6 original test scenarios preserved

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Move remaining forEachEngine tests to legacy/ with README.md of action items

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Migrate infinite-loop-protection.test.ts to regressionTest (partial)

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Fix infinite-loop-protection.test.ts: fix traversal coverage and graphql replay failures

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* Fix serializer: support expressions, ternary, coalesce, string interpolation in tool self-wires

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* test: migrate tool-self-wires-runtime to regressionTest harness

Move test/legacy/tool-self-wires-runtime.test.ts to
test/tool-self-wires-runtime.test.ts using the regressionTest pattern
with test.multitool from bridge-tools.ts.

All 9 test cases are consolidated into a single regressionTest block
with shared const declarations and per-scenario assertions. The
compiler handles all cases natively so allowDowngrade is not needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: migrate native-batching tests to regressionTest harness

- Migrate all 3 tests from forEachEngine to regressionTest pattern
- Fix serializer bug: loop-scoped tool handles now round-trip correctly
  - Add element property to HandleBinding type for tool handles
  - Mark element-scoped tools in parser (processLocalToolBindings)
  - Serializer skips element handles in header, emits inside array blocks
  - Serializer correctly identifies element-scoped tool wires
- Delete legacy/native-batching.test.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update legacy README with migration patterns and remove migrated files

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>

* New tsc setup

* Fix build

* feat: add bridge-types dependency to bridge-compiler and update pnpm-lock

* feat: refactor multitool functions for improved error handling and cleanup

* Fix graphql control flog bug

* Control flow tests are migrated

* Test structure

* feat: more compiler coverage

* feat: enhance error handling and add new regression tests for expressions

* fix: fuzzer

* Tests

* Some progress

* Move back to legacy

* fix tests

* fix: update tools type to Record<string, unknown> in buildAotFn and compileAndRun

* Hallukad jalle

* Test stability

* Broke a bunch of things

* Fixed some stuff

* Broke some stuff/ fixed some more stuff

* Fixed more stuff

* Broke some stuff again

* Did not really mnage to fix all

* Half fixes

* Now to graphql

* graphql tessts

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Aarne Laur <aarne.laur@gmail.com>
@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2026

⚠️ No Changeset found

Latest commit: f758e54

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bridge f758e54 Commit Preview URL

Branch Preview URL
Mar 13 2026, 12:28 PM

@github-actions
Copy link
Contributor

🐰 Bencher Report

Branchnew_test_harness
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
compiled: absolute baseline (passthrough, no tools)📈 view plot
⚠️ NO THRESHOLD
0.00 ns
compiled: array + SYNC tool-per-element 10📈 view plot
⚠️ NO THRESHOLD
0.01 ns
compiled: array + SYNC tool-per-element 100📈 view plot
⚠️ NO THRESHOLD
0.02 ns
compiled: array + tool-per-element 10📈 view plot
⚠️ NO THRESHOLD
0.01 ns
compiled: array + tool-per-element 100📈 view plot
⚠️ NO THRESHOLD
0.04 ns
compiled: chained 3-tool fan-out📈 view plot
⚠️ NO THRESHOLD
0.01 ns
compiled: flat array 10 items📈 view plot
⚠️ NO THRESHOLD
0.01 ns
compiled: flat array 100 items📈 view plot
⚠️ NO THRESHOLD
0.02 ns
compiled: flat array 1000 items📈 view plot
⚠️ NO THRESHOLD
0.12 ns
compiled: nested array 10x10📈 view plot
⚠️ NO THRESHOLD
0.03 ns
compiled: nested array 20x10📈 view plot
⚠️ NO THRESHOLD
0.05 ns
compiled: nested array 5x5📈 view plot
⚠️ NO THRESHOLD
0.01 ns
compiled: short-circuit (overdefinition bypass)📈 view plot
⚠️ NO THRESHOLD
0.00 ns
compiled: simple chain (1 tool)📈 view plot
⚠️ NO THRESHOLD
0.00 ns
exec: absolute baseline (passthrough, no tools)📈 view plot
⚠️ NO THRESHOLD
0.01 ns
exec: array + SYNC tool-per-element 10📈 view plot
⚠️ NO THRESHOLD
0.11 ns
exec: array + SYNC tool-per-element 100📈 view plot
⚠️ NO THRESHOLD
0.96 ns
exec: array + tool-per-element 10📈 view plot
⚠️ NO THRESHOLD
0.12 ns
exec: array + tool-per-element 100📈 view plot
⚠️ NO THRESHOLD
1.08 ns
exec: chained 3-tool fan-out📈 view plot
⚠️ NO THRESHOLD
0.06 ns
exec: flat array 10 items📈 view plot
⚠️ NO THRESHOLD
0.02 ns
exec: flat array 100 items📈 view plot
⚠️ NO THRESHOLD
0.10 ns
exec: flat array 1000 items📈 view plot
⚠️ NO THRESHOLD
0.86 ns
exec: nested array 10x10📈 view plot
⚠️ NO THRESHOLD
0.16 ns
exec: nested array 20x10📈 view plot
⚠️ NO THRESHOLD
0.30 ns
exec: nested array 5x5📈 view plot
⚠️ NO THRESHOLD
0.06 ns
exec: short-circuit (overdefinition bypass)📈 view plot
⚠️ NO THRESHOLD
0.01 ns
exec: simple chain (1 tool)📈 view plot
⚠️ NO THRESHOLD
0.01 ns
parse: large bridge (20 handles x 5 wires)📈 view plot
⚠️ NO THRESHOLD
1.34 ns
parse: simple bridge📈 view plot
⚠️ NO THRESHOLD
0.04 ns
🐰 View full continuous benchmarking report in Bencher

@aarne aarne merged commit f49d30f into unify_wires Mar 13, 2026
4 checks passed
@aarne aarne deleted the new_test_harness branch March 13, 2026 12:32
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.

2 participants