-
Notifications
You must be signed in to change notification settings - Fork 28
π€ refactor: simplify CI and tests folder structure #908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
a9223c8 to
8ade4f1
Compare
Implements a coverage-based test selection system to reduce CI time by running only the integration tests affected by code changes. Components: - generate-coverage-map.ts: Runs tests individually with coverage to build a reverse index (source file β tests that cover it) - select-affected-tests.ts: Selects tests based on changed files, with safe fallbacks for infrastructure changes, new tests, and unmapped files - coverage-map.yml: Daily workflow to regenerate the map and cache it - Updated ci.yml: Restores map from cache and runs selective tests Safety features: - Falls back to all tests when map is missing/stale (>7 days) - Infrastructure files (jest config, package.json, etc.) trigger all tests - New/unmapped source files trigger all tests - Exit code 2 signals fallback, ensuring CI always runs correct tests _Generated with `mux`_
- Remove run-selective-tests.sh (logic is inline in CI workflow) - Move CI/.github from infrastructure to ignored (doesn't affect tests) - Add more ignored patterns (e2e tests, electron-builder) - Fix verbose output capture in CI workflow - Minor comment improvements
3e29444 to
eca7ff6
Compare
Consolidate ci.yml and build.yml into a single pr.yml workflow with selective execution based on changed files. Changes: - Rename ci.yml β pr.yml, merge in build.yml jobs - Add dorny/paths-filter to detect docs-only PRs - Skip all tests/builds for docs-only changes - Consistent job naming: Test/*, Build/*, Smoke/* - Single 'required' job for branch protection Job structure: - changes: detect docs-only PRs - static-check: lint, typecheck, fmt - test-unit, test-integration, test-storybook, test-e2e - smoke-server, smoke-docker (merge_group only) - build-linux, build-macos, build-vscode - codex-comments - required: aggregates all job results Configure branch protection to require only 'PR / Required'. _Generated with `mux`_
eca7ff6 to
f371a13
Compare
- Flatten tests/integration/ipc/ to tests/ipc/ - Move tests/models/knownModels.test.ts to src/common/constants/ (colocate with implementation) - Delete orphan tests/worker-test.test.ts - Update CI to run tests/ipc + tests/runtime (fixes runtime tests not running) - Update paths-filter backend filter for new structure Tests philosophy: unit tests colocated in src/, integration tests in tests/
Instead of skipping the entire integration job, compute which test directories to run based on paths-filter outputs: - ipc filter: src/node/services, orpc, config, git, utils, common, cli, desktop, tests/ipc - runtime filter: src/node/runtime, tests/runtime - config changes: run all integration tests - manual override: workflow_dispatch test_filter still works The job always runs (unless docs-only), but tests are scoped to relevant changes.
b27e12f to
5adce51
Compare
- docs-only: skip entire integration job (job-level if) - browser-only: skip tests/ipc, run all other tests under tests/ - otherwise: run ALL tests under tests/ (new directories auto-included) Uses --testPathIgnorePatterns for browser-only exclusion. Jest's testMatch only picks up *.test.ts, so e2e/*.spec.ts is already excluded.
5adce51 to
e6ca02e
Compare
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.
Summary
Simplify CI workflow and reorganize tests folder for cleaner filtering.
Tests Folder Reorganization
Philosophy: Unit tests colocated in
src/, integration tests intests/.tests/integration/ipc/βtests/ipc/tests/models/knownModels.test.tsβsrc/common/constants/(colocated with implementation)CI Integration Test Filtering
tests/excludingtests/ipc/tests/Future-proof: New
tests/foo/*.test.tsdirectories are automatically included. Uses--testPathIgnorePatternsfor browser-only exclusion instead of hardcoding paths.Other Changes
tests/**with!tests/e2e/**exclusionGenerated with
mux