Repository navigation
ci: run the benchmark, measure runner coverage and fail on circular mports - #358
Merged
Merged
Conversation
nev21
commented
Oct 26, 2026
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
nevware21-bot
previously approved these changes
Oct 26, 2026
nevware21-bot
left a comment
Contributor
There was a problem hiding this comment.
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.
nev21
enabled auto-merge (squash)
October 27, 2026 04:19
nevware21-bot
approved these changes
Oct 27, 2026
nevware21-bot
left a comment
Contributor
There was a problem hiding this comment.
Approved by nevware21-bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.