Skip to content

refactor: reorganize tests into unit and e2e directories#491

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-03-refactor_client_reorganize_tests_into_unit__and_e2e__folders
Dec 3, 2025
Merged

refactor: reorganize tests into unit and e2e directories#491
graphite-app[bot] merged 1 commit intomainfrom
12-03-refactor_client_reorganize_tests_into_unit__and_e2e__folders

Conversation

@jumski
Copy link
Copy Markdown
Contributor

@jumski jumski commented Dec 3, 2025

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.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 3, 2025

⚠️ No Changeset found

Latest commit: d0f7ca4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor Author

jumski commented Dec 3, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

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.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Dec 3, 2025

View your CI Pipeline Execution ↗ for commit d0f7ca4

Command Status Duration Result
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 24s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 4m 44s View ↗
nx run edge-worker:e2e ✅ Succeeded 2m 47s View ↗
nx run cli:e2e ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-03 17:33:42 UTC

@jumski jumski force-pushed the 12-03-refactor_client_reorganize_tests_into_unit__and_e2e__folders branch from 1e4fa44 to c930054 Compare December 3, 2025 14:20
Comment thread pkgs/client/project.json
"../../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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"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

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented Dec 3, 2025

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.
@graphite-app graphite-app Bot force-pushed the 12-03-fix_test_add_maxworkers_and_remove_unnecessary_db_ensure branch from 7a9d7a5 to ae4d2b9 Compare December 3, 2025 17:24
@graphite-app graphite-app Bot force-pushed the 12-03-refactor_client_reorganize_tests_into_unit__and_e2e__folders branch from c930054 to d0f7ca4 Compare December 3, 2025 17:25
@graphite-app graphite-app Bot changed the base branch from 12-03-fix_test_add_maxworkers_and_remove_unnecessary_db_ensure to main December 3, 2025 17:33
@graphite-app graphite-app Bot merged commit d0f7ca4 into main Dec 3, 2025
8 checks passed
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