Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because there is no eligible user to bill.
An enterprise owner can allow the organization to be billed for reviews like this by enabling Copilot code review for users without a license.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Why
Hub contributors need independent test cases without repeating cleanup hooks in every file. Database tests also need to run in parallel without sharing records or clearing the development database. Closes #111.
This PR is stacked on #108 and targets its
copilot/hub-postgres-prismabranch.What changes
Shared setup restores test state before each case, including mocks, environment changes, timers, browser storage, and leftover document content. Redundant local cleanup hooks are removed. Tests still explicitly dispose resources they create, such as listeners and servers.
Vitest runs files in parallel using forked processes and keeps cases within each worker sequential. A dedicated server test project prepares the current Prisma schema in a new template database, then creates a separate database for each worker. Before every case it clears application records and restarts identities, while retaining migration records. Unique run names isolate simultaneous runs, and teardown drops only databases created by that run.
npm testremains database-free.npm run test:databaseruns.db.test.tsserver cases usingTEST_DATABASE_URL; only this CI command starts PostgreSQL. The contributor guides document the lifecycle and require each case to arrange its own records, act, and assert.CI runs individual checks on every pull request without changed-path selection or aggregate result gates. The old selector and its tests are removed, Starter and Learning no longer filter changed paths, and repository tooling has independent checks. Hub's test jobs are named
Hub unit testsandHub database tests.Repository branch rules are unchanged. Maintainers must replace the removed aggregate checks and legacy Hub checks in applicable rules before requiring the new workflow.