test(frontend): migrate suites to rstest - #2619
Open
malinskibeniamin wants to merge 11 commits into
Open
Conversation
Contributor
✅ Clean — no registry drift, off-token colours, or ad-hoc classesApp:
Generated by lookout audit-changes. |
malinskibeniamin
left a comment
Contributor
Author
There was a problem hiding this comment.
Automated /review: 8 finding(s).
Contributor
Author
Review feedback addressed
All review threads resolved. CI is green. |
malinskibeniamin
requested review from
a team,
SpicyPete,
datamali,
eblairmckee and
yougotashovel
and removed request for
a team
August 28, 2026 08:10
malinskibeniamin
marked this pull request as ready for review
August 28, 2026 08:10
malinskibeniamin
force-pushed
the
ben-malinski/migrate-to-rstest
branch
from
August 30, 2026 12:21
05c63b3 to
df37c2e
Compare
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.
Proven impact (pre-rebase benchmark snapshot)
Timing measurements below compare the exact pre-rebase commits named in the method. After rebasing onto
origin/master@521b27c28, functional guardrails and coverage were rerun on Rstest 0.11.11; the local timing benchmarks were not rerun.d146e980)2e6a2f14)Value proven: warm-cache feedback is materially faster across every affected test workflow, with median reductions of 28.3–80.7%. Every workflow clears the pre-registered 20% threshold, and Rstest was faster in all 25 measured pairs while the full suites ran four additional unit migration-policy tests (841 versus 837) and the restored 27-test integration license suite (1,283 versus 1,256).
Guardrail: all measured runs passed. After rebasing and upgrading to Rstest 0.11.11, all 847 unit, 1,286 integration, and 1 build-backed federation contract test pass, and the unchanged merged V8 coverage thresholds pass.
Federation capability proven: without the federation-aware Rstest project, the static
rp_console/configimport fails in the Module Federation runtime. Withtest:federation, Rstest builds Console's real./configexpose as a Node remote and imports it through@module-federation/rstest; 1/1 contract passes. This is deterministic correctness evidence, not a timing benchmark.CI placement quantified: in the Rstest 0.11.11 GitHub run, the named federation step passed in 4s after the 5s unit step; the complete shared job took 23s. Keeping it as a separate step preserves failure visibility while avoiding a standalone job that would duplicate about 9s of job setup, checkout, Bun setup, and dependency installation. A separate job would not shorten this run's frontend critical path because the build job took 68s. Revisit that boundary when the suite expands beyond the current single built-remote contract.
Rstest 0.11.11 upstream patch impact
Patch value: 0.11.11 replaces quadratic result copying/scans and FIFO
shift()consumption with incremental indexes and cursor-based queues. It also routes federation chunks throughrequireinstead of a virtual filesystem, directly hardening this PR's federation test path. These are upstream isolated microbenchmarks, not Console suite timings; Console's full correctness and coverage guardrails were rerun separately.Method: each workflow used three warm-up pairs, then five measured pairs in alternating order with stdout captured and dependency caches warm. Focused fixtures:
src/utils/string.test.tsandsrc/config.test.tsx. Measured ranges: full unit 2.36–3.22s versus 1.60–1.82s; full integration 83.79–118.75s versus 25.22–40.58s; focused unit 0.53–0.62s versus 0.43–0.47s; focused integration 7.30–15.52s versus 2.27–5.21s; coverage 99.51–134.71s versus 43.99–57.94s. Excluded Vitest full-suite warm-ups hit the existingobservability-pageflake; Rstest warm-ups passed. Apple M5 Max, macOS 26.6.2, Bun 1.4.0, Node 26.7.0; based146e98098a9eeff4906262a9579c05fcddbf48a, candidate2e6a2f14362fc602138409755fc79ed41ee276cd. These are local warm-cache benchmarks, not CI-duration claims.Not benchmarked: the new federation contract's timing because it proves runtime compatibility rather than performance; Playwright E2E is unchanged by this runner migration; watch mode needs a separate interactive rerun-latency harness.
Summary
vitors, using synchronousrs.requireActualfor partial mocks that cross app module cyclestest:federationsuite that statically imports Console's real./configremote through@module-federation/rstest, with a policy guard requiring frontend CI to run itWhy
This follows redpanda-data/cloudv2#29294, adapted for Console's unit, integration, and Module Federation contracts plus its existing V8 coverage pipeline. The proven full-suite, focused-file, and coverage-gate wall-time reductions justify the runner change; the 50% integration worker cap and existing 8 GB Node heap cap are preserved. The federation project closes the remaining runtime boundary by building the production-declared
./configexpose before statically consuming it as a CommonJS remote.Out of scope: no product UI behavior changed. Visual review was intentionally skipped because the
.tsxchanges are test-runner migrations only.Commits
f4f45be5c—test(frontend): migrate suites to rstest4bae5380d—fix(review): restore rstest suite discoverydcffaa1ec—fix(review): name migrated test imports3490a7c43—fix(review): align rstest support files0aa53873f—fix(review): scope legacy runner guardf753ab883—style(review): format migrated mocksc7f3dddc7—fix(review): strengthen restored license coverage2265531e3—test(frontend): add rstest federation contract6c7bfd1a1—ci(frontend): run rstest federation contractdf37c2efb—test(frontend): migrate rebased theme tests1bd5ac25d—build(frontend): upgrade rstest to 0.11.11Reviewer guide
rstest.config.unit.ts,rstest.config.integration.ts, andtest.shared.ts.rstest.setup.tsfor happy-dom and test-harness parity.rstest.config.federation.ts,rsbuild.config.federation-test.ts,tests/federation/rstest-global-setup.ts, and.github/workflows/frontend-verify.ymlfor the build-backed remote contract and CI wiring.rs.requireActualto avoid Rspack evaluation cycles.package.json, lockfiles, andtests/rstest-migration.test.ts.Dogfood evidence
test:unit,test:integration,test:federation,test:ci,test:file:*, andtest:coveragepackage scriptsremoteEntry.cjsand returns the expected value from the exposed config API; merged coverage is 42.42% lines, 41.85% statements, 35.03% functions, and 35.73% branchesrs.requireActual, documented removal of the obsolete React 18 MessageChannel workaround, repaired the restored license-suite mocks, added a Node/CommonJS remote adapter after browser-hosted attempts exposed CORS/container mismatches, then replayed full CI, coverage, and federation suites./configexpose, not browser rendering of./Appor./BridgeApp; full dependency install scripts remain locally blocked by the existingisolated-vmnative build on Node 26.7, so the frozen graph was verified with--ignore-scriptsDependency upgrade path
@rstest/core@0.11.11,@rstest/coverage-v8@0.11.11, and@module-federation/rstest@2.9.0; remove Vitest, its UI/coverage packages, and four test-only Vite plugins@rsbuild/core@2.0.11and@rstest/core@0.11.11peers; no production runtime bundle dependency addedbun auditreports 49 transitive advisories; the new test-only Module Federation tree adds a path to the already-presentfast-uriadvisory, while itsadm-zip@0.6.0andundici@7.29.0versions are outside their flagged ranges; private Buf packages were skipped because their audit endpoint returned 404Test plan
bun install --ignore-scripts --frozen-lockfilebun run lintbun run type:checkbun run test:ci(847 unit + 1,286 integration + 1 federation contract)bun run test:federation -- --bail=1frontend-verify / test-unit(Run Module Federation testsstep)bun run test:coveragebun audit