Skip to content

Increase targeted coverage for parser, codegen, execution tree, and GraphQL transform edge paths#92

Merged
aarne merged 3 commits intomainfrom
copilot/improve-test-coverage
Mar 5, 2026
Merged

Increase targeted coverage for parser, codegen, execution tree, and GraphQL transform edge paths#92
aarne merged 3 commits intomainfrom
copilot/improve-test-coverage

Conversation

Copy link
Contributor

Copilot AI commented Mar 5, 2026

Coverage was notably lower than desired in five hotspots: parser (parser.ts), compiler codegen (codegen.ts), parser serializer (bridge-format.ts), runtime execution tree (ExecutionTree.ts), and GraphQL bridge transform (bridge-transform.ts).
This PR adds focused tests for previously under-exercised branches in those files without changing runtime behavior.

  • Parser diagnostics + reserved-name guards (bridge-parser/src/parser/parser.ts)

    • Added tests for lexer diagnostic emission with concrete range assertions.
    • Added reserved source identifier rejection coverage (input used as const name), hitting assertNotReserved error paths.
  • Serializer edge behavior (bridge-parser/src/bridge-format.ts)

    • Added tests for passthrough shorthand serialization (bridge ... with <tool>).
    • Added tests for compact default handle serialization (with input, with output, with const).
  • Requested field matching branches (bridge-compiler/src/codegen.ts)

    • Added tests for requestedFields parent/child/wildcard matching:
      • parent includes descendants (meta)
      • nested path includes required container (meta.age)
      • one-level wildcard semantics (meta.*)
  • ExecutionTree guard + path traversal branches (bridge-core/src/ExecutionTree.ts)

    • Added tests for max-depth panic path.
    • Added tests for abort handling in shadow array creation.
    • Added tests for applyPath root-safe null handling and array/object-access warning branch.
  • GraphQL transform option + helper branches (bridge-graphql/src/bridge-transform.ts)

    • Added tests for dynamic document source (document(context)) with contextMapper.
    • Added tests for option paths (toolTimeoutMs, maxDepth) applied to root tree.
    • Added coverage for getBridgeTraces empty fallback and useBridgeTracing extension injection.

Example (new requestedFields branch coverage):

const { code } = compileBridge(document, {
  operation: "Query.profile",
  requestedFields: ["meta.*"],
});
const fn = buildAotFn(code);
const data = await fn({ name: "Ada", age: 37, city: "Tallinn" }, {}, {});
assert.deepEqual(data, { meta: { age: 37 } });

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.open-meteo.com
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts --test-coverage-functions=0 s --inspect-publissh --inspect-port=1-c --experimental-tpnpm -r e2e sh (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts --test-coverage-functions=0 odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node --inspect-publissh --inspect-port=1-c --experimental-tpnpm -r e2e sh (dns block)
  • dummyjson.com
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts --test-coverage-functions=0 s --inspect-publissh --inspect-port=1-c --experimental-tpnpm -r e2e sh (dns block)
  • nominatim.openstreetmap.org
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts --test-coverage-functions=0 s --inspect-publissh --inspect-port=1-c --experimental-tpnpm -r e2e sh (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts --test-coverage-functions=0 odules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin/node --inspect-publissh --inspect-port=1-c --experimental-tpnpm -r e2e sh (dns block)
  • transport.opendata.ch
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts --test-coverage-functions=0 bin/ps --inspect-publissh --inspect-port=1-c --experimental-tpnpm -r e2e sh (dns block)
  • v6.db.api.bahn.guru
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --heap-prof-interval=524288 --cpu-prof-interval=1000 --test-coverage-functions=0 --test-concurrency=0 --inspect-publish-uid=stderr,http --inspect-port=127.0.0.1:9229 --experimental-transform-types --report-signal=SIGUSR2 --test-coverage-lines=0 --test-isolation=process --conditions=source --tls-cipher-list=TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA est/*.test.ts --test-coverage-functions=0 bin/ps --inspect-publissh --inspect-port=1-c --experimental-tpnpm -r e2e sh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@changeset-bot
Copy link

changeset-bot bot commented Mar 5, 2026

⚠️ No Changeset found

Latest commit: 025f5d4

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

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 5, 2026

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 025f5d4 Commit Preview URL

Branch Preview URL
Mar 05 2026, 10:18 AM

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve test coverage for bridge packages Increase targeted coverage for parser, codegen, execution tree, and GraphQL transform edge paths Mar 5, 2026
Copilot finished work on behalf of aarne March 5, 2026 10:19
@aarne aarne marked this pull request as ready for review March 5, 2026 10:21
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

🐰 Bencher Report

Branchcopilot/improve-test-coverage
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
compiled: absolute baseline (passthrough, no tools)📈 view plot
🚷 view threshold
0.00 ns
(+2.36%)Baseline: 0.00 ns
0.00 ns
(93.80%)
compiled: array + tool-per-element 10📈 view plot
🚷 view threshold
0.01 ns
(-1.17%)Baseline: 0.01 ns
0.01 ns
(92.65%)
compiled: array + tool-per-element 100📈 view plot
🚷 view threshold
0.03 ns
(-2.18%)Baseline: 0.03 ns
0.04 ns
(91.90%)
compiled: chained 3-tool fan-out📈 view plot
🚷 view threshold
0.00 ns
(+1.44%)Baseline: 0.00 ns
0.00 ns
(94.33%)
compiled: flat array 10 items📈 view plot
🚷 view threshold
0.01 ns
(+0.20%)Baseline: 0.01 ns
0.01 ns
(93.33%)
compiled: flat array 100 items📈 view plot
🚷 view threshold
0.01 ns
(-0.34%)Baseline: 0.01 ns
0.01 ns
(93.97%)
compiled: flat array 1000 items📈 view plot
🚷 view threshold
0.07 ns
(-0.49%)Baseline: 0.07 ns
0.07 ns
(94.74%)
compiled: nested array 10x10📈 view plot
🚷 view threshold
0.02 ns
(+0.58%)Baseline: 0.02 ns
0.02 ns
(94.47%)
compiled: nested array 20x10📈 view plot
🚷 view threshold
0.03 ns
(-0.61%)Baseline: 0.03 ns
0.04 ns
(93.82%)
compiled: nested array 5x5📈 view plot
🚷 view threshold
0.01 ns
(+0.21%)Baseline: 0.01 ns
0.01 ns
(94.10%)
compiled: short-circuit (overdefinition bypass)📈 view plot
🚷 view threshold
0.00 ns
(+2.04%)Baseline: 0.00 ns
0.00 ns
(93.63%)
compiled: simple chain (1 tool)📈 view plot
🚷 view threshold
0.00 ns
(+1.83%)Baseline: 0.00 ns
0.00 ns
(93.41%)
exec: absolute baseline (passthrough, no tools)📈 view plot
🚷 view threshold
0.00 ns
(+6.51%)Baseline: 0.00 ns
0.00 ns
(86.41%)
exec: array + tool-per-element 10📈 view plot
🚷 view threshold
0.08 ns
(+4.88%)Baseline: 0.08 ns
0.10 ns
(78.19%)
exec: array + tool-per-element 100📈 view plot
🚷 view threshold
0.74 ns
(+9.04%)Baseline: 0.68 ns
0.94 ns
(79.00%)
exec: chained 3-tool fan-out📈 view plot
🚷 view threshold
0.02 ns
(+14.98%)Baseline: 0.01 ns
0.02 ns
(84.57%)
exec: flat array 10 items📈 view plot
🚷 view threshold
0.01 ns
(-8.44%)Baseline: 0.02 ns
0.04 ns
(39.98%)
exec: flat array 100 items📈 view plot
🚷 view threshold
0.08 ns
(-23.65%)Baseline: 0.10 ns
0.32 ns
(23.18%)
exec: flat array 1000 items📈 view plot
🚷 view threshold
0.69 ns
(-31.26%)Baseline: 1.00 ns
3.94 ns
(17.41%)
exec: nested array 10x10📈 view plot
🚷 view threshold
0.12 ns
(-16.70%)Baseline: 0.15 ns
0.39 ns
(31.12%)
exec: nested array 20x10📈 view plot
🚷 view threshold
0.24 ns
(-17.84%)Baseline: 0.29 ns
0.81 ns
(29.60%)
exec: nested array 5x5📈 view plot
🚷 view threshold
0.05 ns
(-8.74%)Baseline: 0.05 ns
0.11 ns
(43.65%)
exec: short-circuit (overdefinition bypass)📈 view plot
🚷 view threshold
0.00 ns
(+9.51%)Baseline: 0.00 ns
0.00 ns
(96.82%)
exec: simple chain (1 tool)📈 view plot
🚷 view threshold
0.01 ns
(+11.70%)Baseline: 0.01 ns
0.01 ns
(85.88%)
parse: large bridge (20 handles x 5 wires)📈 view plot
🚷 view threshold
1.19 ns
(+20.78%)Baseline: 0.99 ns
1.36 ns
(87.74%)
parse: simple bridge📈 view plot
🚷 view threshold
0.04 ns
(+28.57%)Baseline: 0.03 ns
0.05 ns
(90.36%)
🐰 View full continuous benchmarking report in Bencher

@aarne aarne merged commit be74193 into main Mar 5, 2026
13 of 14 checks passed
@aarne aarne deleted the copilot/improve-test-coverage branch March 5, 2026 10:26
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