Skip to content

ci: run the benchmark, measure runner coverage and fail on circular mports - #358

Merged
nev21 merged 3 commits into
mainfrom
nev21/CiChecks
Oct 27, 2026
Merged

nev21 merged 3 commits into
mainfrom
nev21/CiChecks

Conversation

@nev21

@nev21 nev21 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor
  • CI runs the benchmark once, on Node 22, after the unit tests, and uploads internal/runner coverage under a new runner Codecov flag with a 30% floor.
  • The core, chai shim and runner rollup configs now fail the build on a circular import between this repository's own modules instead of printing a warning, since module evaluation order then depends on which file loads first. Cycles wholly inside packages under node_modules are still warnings, and circularImports.test.ts checks both cases with real rollup builds of each config.
  • core/scripts/copyRunnerBin.js now writes core/node_modules/@nevware21/tripwire as a folder holding only a package.json whose entry points lead back to core/dist, instead of a link to core itself. core contains that folder, so the link was a loop that git clean -xdf (the clean build) and git status --ignored walked until the paths grew too long. The script removes an old link when it finds one, and only the link.
  • A tsconfig with a syntax error crashed with TypeScript's internal "Debug Failure" on Windows instead of being reported, because readConfigFile was given a path with backslashes. tsCompile.ts now passes forward slashes, so the existing fallbacks apply.
  • The browser and worker module graph resolved a folder import that node could not resolve to the folder itself rather than to its index file.
  • browserRunner.ts imported path/win32, which broke --server-root on Linux and macOS. It now imports path.
  • A puppeteer run whose page reported a failure before it finished loading crashed the CLI with an unhandled rejection. The run's completion is now marked handled up front, as the browser warm-up already was, and the failure is still reported by the await that follows.
  • nyc report now runs with --cwd set to the project's own folder, so an nyc run wrapping the CLI, whose NYC_CWD every child process inherits, no longer makes it report another project's files.
  • Runner coverage rises from 47.5% to 97.6% of statements, with 1269 tests across the server, codecov, compile, execute, client, CLI, reporter and browser UI modules.
  • test/src/support/textImports.ts gives node the html, css and ico loaders that rollup's inlining provides, so anything that reaches the browser runner can be imported from source.
  • test/src/support/uxDom.ts is a shared stand-in DOM for the browser UI modules. It replaces five identical copies in the existing UI tests and adds the element, event and document members the rendering, menu, frame mode and page client tests need.
  • cliFromSource.test.ts runs the CLI from the runner's sources in one child process against small temporary projects. It covers the node, browser and worker targets through a stand-in puppeteer, both --watch loops, open and manual launches, and the coverage-report command. Its launcher loads its bootstrap compile past nyc's .ts hook, so every measured file is compiled the same way as in the parent run and nyc never merges two statement maps for one file.
  • The worker runner and the test frame run under node with their global, script loading and messages stood in for, and the real tripwire as the runtime. The page client is loaded fresh for each test against its own stand-in URL, elements and timers.
  • core's browser and worker /api/status tests, commented out since they were added, are re-enabled. They skip when the page or worker was not loaded by tripwire's runner, since the benchmark's karma arms load the same folders and nothing there serves /api/status.

@nev21
nev21 requested review from a team as code owners October 26, 2026 07:26
Copilot AI balanced review requested due to automatic review settings October 26, 2026 07:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.03%. Comparing base (825aaa9) to head (53bd09b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #358      +/-   ##
==========================================
+ Coverage   96.71%   97.03%   +0.32%     
==========================================
  Files         219      323     +104     
  Lines        9822    16848    +7026     
  Branches     2631     4595    +1964     
==========================================
+ Hits         9499    16349    +6850     
- Misses        323      499     +176     
Files with missing lines Coverage Δ
internal/runner/src/codecov/nycReport.ts 92.59% <100.00%> (ø)
internal/runner/src/compile/tsCompile.ts 95.15% <100.00%> (ø)
internal/runner/src/execute/browser.ts 98.07% <100.00%> (ø)
internal/runner/src/execute/browserRunner.ts 97.35% <100.00%> (ø)
internal/runner/src/execute/puppeteer.ts 96.05% <100.00%> (ø)
internal/runner/src/execute/targetSessionCache.ts 100.00% <100.00%> (ø)

... and 98 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

nevware21-bot
nevware21-bot previously approved these changes Oct 26, 2026

@nevware21-bot nevware21-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

…mports

- CI runs the benchmark once, on Node 22, after the unit tests, and uploads internal/runner coverage under a new runner Codecov flag with a 30% floor.
- The core, chai shim and runner rollup configs now fail the build on a circular import between this repository's own modules instead of printing a warning, since module evaluation order then depends on which file loads first. Cycles wholly inside packages under node_modules are still warnings, and circularImports.test.ts checks both cases with real rollup builds of each config.
- core/scripts/copyRunnerBin.js now writes core/node_modules/@nevware21/tripwire as a folder holding only a package.json whose entry points lead back to core/dist, instead of a link to core itself. core contains that folder, so the link was a loop that git clean -xdf (the clean build) and git status --ignored walked until the paths grew too long. The script removes an old link when it finds one, and only the link.
- A tsconfig with a syntax error crashed with TypeScript's internal "Debug Failure" on Windows instead of being reported, because readConfigFile was given a path with backslashes. tsCompile.ts now passes forward slashes, so the existing fallbacks apply.
- The browser and worker module graph resolved a folder import that node could not resolve to the folder itself rather than to its index file.
- browserRunner.ts imported path/win32, which broke --server-root on Linux and macOS. It now imports path.
- A puppeteer run whose page reported a failure before it finished loading crashed the CLI with an unhandled rejection. The run's completion is now marked handled up front, as the browser warm-up already was, and the failure is still reported by the await that follows.
- nyc report now runs with --cwd set to the project's own folder, so an nyc run wrapping the CLI, whose NYC_CWD every child process inherits, no longer makes it report another project's files.
- Runner coverage rises from 47.5% to 97.6% of statements, with 1269 tests across the server, codecov, compile, execute, client, CLI, reporter and browser UI modules.
- test/src/support/textImports.ts gives node the html, css and ico loaders that rollup's inlining provides, so anything that reaches the browser runner can be imported from source.
- test/src/support/uxDom.ts is a shared stand-in DOM for the browser UI modules. It replaces five identical copies in the existing UI tests and adds the element, event and document members the rendering, menu, frame mode and page client tests need.
- cliFromSource.test.ts runs the CLI from the runner's sources in one child process against small temporary projects. It covers the node, browser and worker targets through a stand-in puppeteer, both --watch loops, open and manual launches, and the coverage-report command. Its launcher loads its bootstrap compile past nyc's .ts hook, so every measured file is compiled the same way as in the parent run and nyc never merges two statement maps for one file.
- The worker runner and the test frame run under node with their global, script loading and messages stood in for, and the real tripwire as the runtime. The page client is loaded fresh for each test against its own stand-in URL, elements and timers.
- core's browser and worker /api/status tests, commented out since they were added, are re-enabled. They skip when the page or worker was not loaded by tripwire's runner, since the benchmark's karma arms load the same folders and nothing there serves /api/status.
Copilot AI balanced review requested due to automatic review settings October 27, 2026 04:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 04:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 04:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 04:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@nev21
nev21 enabled auto-merge (squash) October 27, 2026 04:19

@nevware21-bot nevware21-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

@nev21
nev21 merged commit bcdd464 into main Oct 27, 2026
11 checks passed
@nev21
nev21 deleted the nev21/CiChecks branch October 27, 2026 04:30
@nev21 nev21 added this to the 0.2.0 milestone Oct 27, 2026
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.

3 participants