refactor: reorganize tests into unit and e2e directories#491
Conversation
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
View your CI Pipeline Execution ↗ for commit d0f7ca4
☁️ Nx Cloud last updated this comment at |
1e4fa44 to
c930054
Compare
| "../../scripts/supabase-start-locked.sh .", | ||
| "psql 'postgresql://postgres:postgres@localhost:50522/postgres' -c 'SELECT pgflow_tests.reset_db()'", | ||
| "vitest run __tests__/ --poolOptions.threads.singleThread" | ||
| "vitest run __tests__/ --config vitest.e2e.config.ts --poolOptions.threads.singleThread" |
There was a problem hiding this comment.
This command runs ALL tests under __tests__/ (including both unit and e2e tests) but forces them to use the e2e configuration. This will cause unit tests to run with the e2e global setup, which is inefficient and potentially incorrect.
The command should be changed to either:
"vitest run __tests__/e2e/ --config vitest.e2e.config.ts --poolOptions.threads.singleThread"to only run e2e tests, or use separate commands for unit and e2e tests if running all tests is intended.
| "vitest run __tests__/ --config vitest.e2e.config.ts --poolOptions.threads.singleThread" | |
| "vitest run __tests__/e2e/ --config vitest.e2e.config.ts --poolOptions.threads.singleThread" |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
Merge activity
|
# Reorganize Test Directory Structure for Better Separation of Unit and E2E Tests This PR reorganizes the test directory structure to clearly separate unit tests from end-to-end tests: - Moved all integration tests from `__tests__/integration/` to `__tests__/e2e/` - Relocated unit tests from the root `__tests__/` directory to `__tests__/unit/` - Updated import paths in test files to reflect the new directory structure - Created a separate Vitest configuration for E2E tests (`vitest.e2e.config.ts`) - Renamed `vitest.global-setup.ts` to `vitest.e2e.global-setup.ts` to clarify its purpose - Updated the project.json configuration to use the appropriate test commands for each test type This change improves the organization of our test suite and makes it clearer which tests are unit tests and which are end-to-end tests, while maintaining all existing test functionality.
7a9d7a5 to
ae4d2b9
Compare
c930054 to
d0f7ca4
Compare

Reorganize Test Directory Structure for Better Separation of Unit and E2E Tests
This PR reorganizes the test directory structure to clearly separate unit tests from end-to-end tests:
__tests__/integration/to__tests__/e2e/__tests__/directory to__tests__/unit/vitest.e2e.config.ts)vitest.global-setup.tstovitest.e2e.global-setup.tsto clarify its purposeThis change improves the organization of our test suite and makes it clearer which tests are unit tests and which are end-to-end tests, while maintaining all existing test functionality.