Skip to content

feat: unify browser mode and node mode summary report#883

Merged
fi3ework merged 5 commits intomainfrom
browser-report
Jan 20, 2026
Merged

feat: unify browser mode and node mode summary report#883
fi3ework merged 5 commits intomainfrom
browser-report

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Jan 20, 2026

Summary

  • unify browser mode and node mode summary report
  • make browser mode and node mode parallel execution

before:
image

after:
image

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 20, 2026 04:23
@9aoy 9aoy requested review from fi3ework and removed request for Copilot January 20, 2026 04:28
@fi3ework
Copy link
Copy Markdown
Member

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f30a640758

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 56 to +60
if (hasBrowserTests) {
// Pass project roots to resolve @rstest/browser from project-specific node_modules
const projectRoots = browserProjects.map((p) => p.rootPath);
const { runBrowserTests } = await loadBrowserModule({ projectRoots });
await runBrowserTests(context);
// Start browser tests in parallel (don't await yet)
browserResultPromise = runBrowserModeTests(context, browserProjects, {
skipOnTestRunEnd: shouldUnifyReporter,
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Attach handler for parallel browser run promise

Starting the browser run without an attached rejection handler means any early failure (e.g., failing to resolve @rstest/browser, Playwright launch errors, or config import errors) can reject before the later await in run() attaches, which triggers an unhandledRejection event; in Node with --unhandled-rejections=strict or stricter test runners this can terminate the process and skip node-mode cleanup/reporting. Consider attaching .catch immediately or awaiting both via Promise.all so rejections are handled as part of the main control flow.

Useful? React with 👍 / 👎.

Copilot AI review requested due to automatic review settings January 20, 2026 05:54
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Jan 20, 2026

Deploying rstest with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5dd323e
Status: ✅  Deploy successful!
Preview URL: https://7e0c9a31.rstest.pages.dev
Branch Preview URL: https://browser-report.rstest.pages.dev

View logs

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Unifies the summary report output between browser-mode and node-mode test runs, and enables running browser and node tests in parallel.

Changes:

  • Runs browser tests and node tests concurrently and (in non-watch mode) emits a single unified reporter summary.
  • Adds a structured return value from @rstest/browser test runs to support unified duration/failure reporting.
  • Centralizes Rsbuild logger level configuration based on debug mode.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/core/src/core/runTests.ts Runs browser + node tests in parallel and unifies reporter output/duration/failure handling.
packages/core/src/core/rsbuild.ts Moves debug logger configuration to module scope for Rsbuild.
packages/core/src/core/browserLoader.ts Extends browser module typing to support options and returning a run result.
packages/browser/src/index.ts Exposes new browser run options/result types and forwards options to controller.
packages/browser/src/hostController.ts Implements skipOnTestRunEnd and returns structured run results for unified reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 9 to +42
export interface BrowserModule {
runBrowserTests: (context: unknown) => Promise<void>;
runBrowserTests: (
context: unknown,
options?: BrowserTestRunOptions,
) => Promise<BrowserTestRunResult | void>;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

This change makes runBrowserTests accept an options parameter and (optionally) return a structured result. The ambient module declaration in packages/core/src/env.d.ts still declares runBrowserTests(context): Promise<void> without options/return value; it should be updated to match the new signature so TypeScript consumers don't get incorrect types.

Copilot uses AI. Check for mistakes.
@fi3ework fi3ework merged commit b88d347 into main Jan 20, 2026
9 checks passed
@fi3ework fi3ework deleted the browser-report branch January 20, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants