diff --git a/.gitea/workflows/hub-check.yml b/.gitea/workflows/hub-check.yml index 1518179..7b7e010 100644 --- a/.gitea/workflows/hub-check.yml +++ b/.gitea/workflows/hub-check.yml @@ -7,11 +7,10 @@ name: hub check on: push: - pull_request: workflow_dispatch: concurrency: - group: hub-check-${{ github.workflow }}-${{ github.ref }} + group: hub-check-${{ github.ref }} cancel-in-progress: true jobs: diff --git a/hub/test/integration/helpers.ts b/hub/test/integration/helpers.ts index 60f8ed2..29491b3 100644 --- a/hub/test/integration/helpers.ts +++ b/hub/test/integration/helpers.ts @@ -69,16 +69,18 @@ export async function resetDb(): Promise { END IF; END $$; `); + const leftover = await prisma.organization.count(); + if (leftover !== 0) { + throw new Error(`resetDb truncate left ${leftover} organization row(s)`); + } await seedTestOrganization(); } + export async function seedTestOrganization( id: string = DEFAULT_ORG_ID, slug: string = "test-default", ): Promise { - // Prefer explicit create-after-wipe over upsert: leftover half-states after - // interrupted tests made Prisma upsert hit unique(id) while where saw zero. await prisma.$transaction(async (tx) => { - await tx.organization.deleteMany({ where: { OR: [{ id }, { slug }] } }); await tx.organization.create({ data: { id, diff --git a/hub/vitest.config.ts b/hub/vitest.config.ts index f9623a9..0b64ad5 100644 --- a/hub/vitest.config.ts +++ b/hub/vitest.config.ts @@ -7,6 +7,7 @@ export default defineConfig({ // concurrent truncate/insert races. Unit tests are fast either way. pool: "forks", fileParallelism: false, + maxWorkers: 1, env: { NODE_ENV: "test" }, }, });