Skip to content

feat: support run related tests#1172

Merged
9aoy merged 13 commits intomainfrom
related-tests
May 6, 2026
Merged

feat: support run related tests#1172
9aoy merged 13 commits intomainfrom
related-tests

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Apr 15, 2026

Summary

Add --related / --findRelatedTests support so Rstest can resolve affected test files from source file inputs before running or listing tests. The filtering now uses stats/module-graph data for both Node mode and Browser Mode.

Use --related when you want Rstest to treat positional arguments as source files and only run the tests that depend on those files.

npx rstest run --related src/button.ts

Rstest resolves related tests from the build module graph, so the same filter works for Node mode and Browser Mode projects. You can also use the Jest-compatible alias:

npx rstest run --findRelatedTests src/button.ts

If you only want to inspect the affected test files, combine it with rstest list:

npx rstest list --related src/button.ts --filesOnly

Related Links

None

Checklist

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 15, 2026

Deploying rstest with  Cloudflare Pages  Cloudflare Pages

Latest commit: f598434
Status: ✅  Deploy successful!
Preview URL: https://d75529dc.rstest.pages.dev
Branch Preview URL: https://related-tests.rstest.pages.dev

View logs

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: d6683385bd

ℹ️ 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 thread packages/core/src/core/related.ts Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Rsdoctor Bundle Diff Analysis

Found 12 projects in monorepo, 2 projects with changes.

📊 Quick Summary
Project Total Size Change
adapter-rsbuild 2.2 KB 0
adapter-rslib 23.2 KB 0
adapter-rspack 5.9 KB 0
browser 2.0 MB +3.1 KB (0.2%)
browser-react 3.7 KB 0
browser-ui 803.5 KB 0
coverage-istanbul 9.6 KB 0
core/browser 964.7 KB 0
core/loaders 869.0 B 0
core/main 1.6 MB +14.4 KB (0.9%)
vscode/extension 59.0 MB 0
vscode/worker 14.4 KB 0
📋 Detailed Reports (Click to expand)

📁 browser

Path: packages/browser/.rsdoctor/rsdoctor-data.json

📌 Baseline Commit: 63d275126e | PR: #1220

Metric Current Baseline Change
📊 Total Size 2.0 MB 2.0 MB +3.1 KB (0.2%)
📄 JavaScript 2.0 MB 2.0 MB +3.1 KB (0.2%)
🎨 CSS 11.8 KB 11.8 KB 0
🌐 HTML 765.0 B 765.0 B 0
📁 Other Assets 96.0 B 96.0 B 0

📦 Download Diff Report: browser Bundle Diff

📁 core/main

Path: packages/core/.rsdoctor/main/rsdoctor-data.json

📌 Baseline Commit: 63d275126e | PR: #1220

Metric Current Baseline Change
📊 Total Size 1.6 MB 1.6 MB +14.4 KB (0.9%)
📄 JavaScript 1.5 MB 1.5 MB +14.4 KB (0.9%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 79.2 KB 79.2 KB 0

📦 Download Diff Report: core/main Bundle Diff

Generated by Rsdoctor GitHub Action

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: a22c06f138

ℹ️ 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 thread packages/core/src/core/related.ts Outdated
Comment thread packages/core/src/core/related.ts Outdated
@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented Apr 15, 2026

Merging this PR will not alter performance

✅ 1 untouched benchmark
⏩ 3 skipped benchmarks1


Comparing related-tests (9df27d7) with main (dbf6901)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (c8ae256) during the generation of this report, so dbf6901 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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: 158d175325

ℹ️ 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 thread packages/core/src/core/related.ts Outdated
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: c4a8eb85c3

ℹ️ 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 thread packages/core/src/core/related.ts
Comment thread packages/core/src/core/related.ts Outdated
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: 93b536cb31

ℹ️ 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 thread packages/core/src/cli/commands.ts Outdated
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: 9bebc50c73

ℹ️ 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 thread packages/core/src/core/runTests.ts Outdated
Comment thread packages/core/src/core/runTests.ts Outdated
Comment thread packages/core/src/core/related.ts Outdated
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: 80e4d7b6e5

ℹ️ 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 thread packages/core/src/core/runTests.ts Outdated
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: 133464ec18

ℹ️ 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 thread packages/core/src/core/runTests.ts Outdated
Comment thread packages/core/src/core/related.ts
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: 9df27d7dcc

ℹ️ 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 thread packages/core/src/core/runTests.ts
Comment thread packages/core/src/utils/testFiles.ts Outdated
@9aoy 9aoy requested a review from fi3ework May 6, 2026 08:13
@9aoy 9aoy merged commit dec1746 into main May 6, 2026
18 checks passed
@9aoy 9aoy deleted the related-tests branch May 6, 2026 09:36
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.

2 participants