Skip to content

Collapsed forEach test loops and removed unnecessary isolation#27064

Merged
9larsons merged 3 commits intomainfrom
e2e-test-cleanup-phase2
Apr 1, 2026
Merged

Collapsed forEach test loops and removed unnecessary isolation#27064
9larsons merged 3 commits intomainfrom
e2e-test-cleanup-phase2

Conversation

@9larsons
Copy link
Copy Markdown
Contributor

@9larsons 9larsons commented Apr 1, 2026

Summary

forEach collapse:

  • force-upgrade.test.ts: Two NAV_ITEMS.forEach() loops were generating 14 per-test-isolated tests, each spinning up its own Ghost instance to assert the billing iframe is visible. Collapsed into 2 flow tests that iterate nav items within a single instance each. Eliminates ~11 Ghost instance spinups per CI run.
  • navigation.test.ts: NAV_ITEMS.forEach() generating 7 tests collapsed into 1 flow test that iterates all items in sequence.

ISO removal:

  • filter-actions.test.ts: Removed usePerTestIsolation() — both tests create their own fixture data and operate on independent label operations with no shared state conflicts.

No coverage removed. Every assertion is preserved, just grouped into fewer tests with fewer Ghost instances.

Net impact: ~19 fewer test() calls, ~13 fewer Ghost instance spinups per CI run.

Test plan

  • CI e2e tests pass on all 8 shards

9larsons added 3 commits April 1, 2026 12:38
Two NAV_ITEMS.forEach() loops were generating 14 per-test-isolated
tests, each spinning up its own Ghost instance to assert the billing
iframe is visible. Collapsed into 2 flow tests that iterate nav items
within a single instance. Eliminates ~11 Ghost instance spinups per
CI run — likely the single most expensive file in the e2e suite.
NAV_ITEMS.forEach() was generating 7 separate tests that each
navigated to /ghost, clicked one link, and checked the URL. Now
a single test iterates all nav items in sequence. Same assertions,
6 fewer tests.
Both tests create their own fixture data via createMany and operate
on independent label operations. Test 1 adds a label, test 2 removes
a different label — no shared state mutation that would cause
interference under per-file isolation.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

Walkthrough

The changes refactor multiple e2e test files to consolidate test structure. Three test files are modified: one removes the per-test isolation setup, and two others restructure their test organization by replacing dynamically generated per-item tests (using forEach and test.describe) with consolidated test cases that iterate over items using for...of loops. The test assertions and navigation interactions remain unchanged.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: collapsing forEach test loops and removing isolation, which are the primary refactoring objectives throughout the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description clearly explains the changes made across three test files, including the rationale for forEach collapsing and per-test isolation removal, with quantified performance improvements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch e2e-test-cleanup-phase2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@9larsons 9larsons merged commit 3024ee8 into main Apr 1, 2026
36 checks passed
@9larsons 9larsons deleted the e2e-test-cleanup-phase2 branch April 1, 2026 18:04
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.

1 participant