Skip to content

Scheduling infrastructure for absolutely everyone.

chore: migrate GitHub workflows from Buildjet to Blacksmith (#26247)

Keith Williams2a6a8e635c8a
diff --git a/.github/actions/cache-db/action.yml b/.github/actions/cache-db/action.yml
index dff9ba52e80..876bebd2a16 100644
--- a/.github/actions/cache-db/action.yml
+++ b/.github/actions/cache-db/action.yml
@@ -16,7 +16,7 @@ runs:
steps:
- name: Cache database
id: cache-db
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
env:
cache-name: cache-db
key-1: ${{ hashFiles('packages/prisma/schema.prisma', 'packages/prisma/migrations/**/**.sql', 'packages/prisma/*.ts') }}
diff --git a/.github/actions/yarn-install/action.yml b/.github/actions/yarn-install/action.yml
index 7ab05bc10fc..6164c4ee8f1 100644
--- a/.github/actions/yarn-install/action.yml
+++ b/.github/actions/yarn-install/action.yml
@@ -20,7 +20,7 @@ runs:
using: "composite"
steps:
- name: Use Node ${{ inputs.node_version }}
- uses: buildjet/setup-node@v4
+ uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- name: Expose yarn config as "$GITHUB_OUTPUT"
@@ -32,7 +32,7 @@ runs:
# Yarn rotates the downloaded cache archives, @see https://github.com/actions/setup-node/issues/325
# Yarn cache is also reusable between arch and os.
- name: Restore yarn cache
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
id: yarn-download-cache
with:
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
@@ -41,7 +41,7 @@ runs:
# Invalidated on yarn.lock changes
- name: Restore node_modules
id: yarn-nm-cache
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
with:
path: "**/node_modules/"
key: ${{ runner.os }}-yarn-nm-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
@@ -49,7 +49,7 @@ runs:
# Invalidated on yarn.lock changes
- name: Restore yarn install state
id: yarn-install-state-cache
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
with:
path: .yarn/ci-cache/
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
diff --git a/.github/actions/yarn-playwright-install/action.yml b/.github/actions/yarn-playwright-install/action.yml
index de1a8c00f41..7d444283c1f 100644
--- a/.github/actions/yarn-playwright-install/action.yml
+++ b/.github/actions/yarn-playwright-install/action.yml
@@ -9,7 +9,7 @@ runs:
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
- name: Cache playwright binaries
id: playwright-cache
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
with:
path: |
~/Library/Caches/ms-playwright
diff --git a/.github/workflows/all-checks.yml b/.github/workflows/all-checks.yml
index d7ca2ce7a08..7fbcb4197c6 100644
--- a/.github/workflows/all-checks.yml
+++ b/.github/workflows/all-checks.yml
@@ -82,7 +82,7 @@ jobs:
required:
needs: [lint, type-check, unit-test, api-v2-unit-test, integration-test, build, build-api-v1, build-api-v2, e2e, e2e-embed, e2e-embed-react, e2e-app-store]
if: always()
- runs-on: buildjet-2vcpu-ubuntu-2204
+ runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: fail if conditional jobs failed
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')
diff --git a/.github/workflows/api-v1-production-build.yml b/.github/workflows/api-v1-production-build.yml
index 00b96bbf696..d3a35bc8f43 100644
--- a/.github/workflows/api-v1-production-build.yml
+++ b/.github/workflows/api-v1-production-build.yml
@@ -43,7 +43,7 @@ env:
jobs:
build:
name: Build API v1
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 30
services:
postgres:
@@ -68,7 +68,7 @@ jobs:
- uses: ./.github/actions/yarn-install
- uses: ./.github/actions/cache-db
- name: Cache API v1 production build
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
id: cache-api-v1-build
env:
cache-name: api-v1-build
diff --git a/.github/workflows/api-v2-production-build.yml b/.github/workflows/api-v2-production-build.yml
index 8bdb3ec2449..a4336b19cb2 100644
--- a/.github/workflows/api-v2-production-build.yml
+++ b/.github/workflows/api-v2-production-build.yml
@@ -12,7 +12,7 @@ jobs:
name: Build API v2
permissions:
contents: read
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 30
services:
postgres:
@@ -36,7 +36,7 @@ jobs:
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- name: Cache API v2 production build
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
id: cache-api-v2-build
env:
cache-name: api-v2-build
diff --git a/.github/workflows/api-v2-unit-tests.yml b/.github/workflows/api-v2-unit-tests.yml
index e1b01077fbd..20d599ccd83 100644
--- a/.github/workflows/api-v2-unit-tests.yml
+++ b/.github/workflows/api-v2-unit-tests.yml
@@ -9,7 +9,7 @@ jobs:
test:
name: API v2 Unit
timeout-minutes: 20
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
diff --git a/.github/workflows/atoms-production-build.yml b/.github/workflows/atoms-production-build.yml
index fd555400a82..6094722d764 100644
--- a/.github/workflows/atoms-production-build.yml
+++ b/.github/workflows/atoms-production-build.yml
@@ -8,14 +8,14 @@ jobs:
name: Build Atoms
permissions:
contents: read
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- uses: ./.github/actions/yarn-install
- name: Cache atoms production build
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
id: cache-atoms-build
env:
cache-name: atoms-build
diff --git a/.github/workflows/cache-clean.yml b/.github/workflows/cache-clean.yml
index 3b0f51ed1fb..121c5b935ea 100644
--- a/.github/workflows/cache-clean.yml
+++ b/.github/workflows/cache-clean.yml
@@ -6,7 +6,7 @@ on:
jobs:
cleanup:
- runs-on: buildjet-2vcpu-ubuntu-2204
+ runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Check out code
uses: actions/checkout@v4
diff --git a/.github/workflows/check-api-v2-breaking-changes.yml b/.github/workflows/check-api-v2-breaking-changes.yml
index 982ad80c237..47c9054a1c5 100644
--- a/.github/workflows/check-api-v2-breaking-changes.yml
+++ b/.github/workflows/check-api-v2-breaking-changes.yml
@@ -27,7 +27,7 @@ jobs:
check-api-v2-breaking-changes:
name: Check API v2 breaking changes
timeout-minutes: 10
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: docker/login-action@v3
with:
diff --git a/.github/workflows/check-types.yml b/.github/workflows/check-types.yml
index 1ef1315a75f..f640b75d963 100644
--- a/.github/workflows/check-types.yml
+++ b/.github/workflows/check-types.yml
@@ -9,7 +9,7 @@ permissions:
contents: read
jobs:
check-types:
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
diff --git a/.github/workflows/companion-build.yml b/.github/workflows/companion-build.yml
index da6913a1a32..12985b43eb2 100644
--- a/.github/workflows/companion-build.yml
+++ b/.github/workflows/companion-build.yml
@@ -12,7 +12,7 @@ env:
jobs:
build:
name: Build Companion App & Extension
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 30
steps:
diff --git a/.github/workflows/delete-buildjet-cache.yml b/.github/workflows/delete-blacksmith-cache.yml
similarity index 51%
rename from .github/workflows/delete-buildjet-cache.yml
rename to .github/workflows/delete-blacksmith-cache.yml
index d63487afcbb..aad432deb0b 100644
--- a/.github/workflows/delete-buildjet-cache.yml
+++ b/.github/workflows/delete-blacksmith-cache.yml
@@ -1,17 +1,17 @@
-name: Manually Delete BuildJet Cache
+name: Manually Delete Blacksmith Cache
on:
workflow_dispatch:
inputs:
cache_key:
- description: "BuildJet Cache Key to Delete"
+ description: "Blacksmith Cache Key to Delete"
required: true
type: string
jobs:
- manually-delete-buildjet-cache:
- runs-on: buildjet-2vcpu-ubuntu-2204
+ manually-delete-blacksmith-cache:
+ runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v4
- - uses: buildjet/cache-delete@v1
+ - uses: useblacksmith/cache-delete@v1
with:
cache_key: ${{ inputs.cache_key }}
diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml
index 729429a078f..abecee2f75d 100644
--- a/.github/workflows/docs-build.yml
+++ b/.github/workflows/docs-build.yml
@@ -9,12 +9,12 @@ jobs:
name: Build Docs
permissions:
contents: read
- runs-on: buildjet-2vcpu-ubuntu-2204
+ runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
- name: Cache Docs build
- uses: buildjet/cache@v4
+ uses: actions/cache@v4
id: cache-docs-build
env:
cache-name: docs-build
diff --git a/.github/workflows/e2e-api-v2.yml b/.github/workflows/e2e-api-v2.yml
index 93c48ced246..3e862901b3d 100644
--- a/.github/workflows/e2e-api-v2.yml
+++ b/.github/workflows/e2e-api-v2.yml
@@ -31,7 +31,7 @@ jobs:
e2e:
timeout-minutes: 20
name: E2E API v2 (${{ matrix.shard }}/${{ strategy.job-total }})
- runs-on: buildjet-16vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
image: postgres:13
diff --git a/.github/workflows/e2e-app-store.yml b/.github/workflows/e2e-app-store.yml
index a74e61b595c..01952477b34 100644
--- a/.github/workflows/e2e-app-store.yml
+++ b/.github/workflows/e2e-app-store.yml
@@ -45,7 +45,7 @@ jobs:
e2e-app-store:
timeout-minutes: 20
name: E2E App Store
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
image: postgres:13
@@ -93,7 +93,7 @@ jobs:
E2E_TEST_CALCOM_GCAL_KEYS: ${{ secrets.E2E_TEST_CALCOM_GCAL_KEYS }}
- uses: ./.github/actions/cache-build
- name: Run Tests
- run: yarn e2e:app-store
+ run: yarn e2e:app-store --workers=4
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v4
diff --git a/.github/workflows/e2e-atoms.yml b/.github/workflows/e2e-atoms.yml
index f6b347dbaa3..38b4bbe289a 100644
--- a/.github/workflows/e2e-atoms.yml
+++ b/.github/workflows/e2e-atoms.yml
@@ -22,7 +22,7 @@ jobs:
e2e-atoms:
timeout-minutes: 15
name: E2E Atoms
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: docker/login-action@v3
with:
diff --git a/.github/workflows/e2e-embed-react.yml b/.github/workflows/e2e-embed-react.yml
index f0a9c5ab298..d82982fadb8 100644
--- a/.github/workflows/e2e-embed-react.yml
+++ b/.github/workflows/e2e-embed-react.yml
@@ -45,7 +45,7 @@ jobs:
e2e-embed:
timeout-minutes: 20
name: E2E Embed React
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
image: postgres:13
@@ -79,7 +79,7 @@ jobs:
- uses: ./.github/actions/cache-build
- name: Run Tests
run: |
- yarn e2e:embed-react
+ yarn e2e:embed-react --workers=4
yarn workspace @calcom/embed-react packaged:tests
- name: Upload Test Results
if: ${{ always() }}
diff --git a/.github/workflows/e2e-embed.yml b/.github/workflows/e2e-embed.yml
index 57b922e6b87..170270fb113 100644
--- a/.github/workflows/e2e-embed.yml
+++ b/.github/workflows/e2e-embed.yml
@@ -45,7 +45,7 @@ jobs:
e2e-embed:
timeout-minutes: 20
name: E2E Embed Core
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
image: postgres:13
@@ -86,7 +86,7 @@ jobs:
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
- name: Run Tests
- run: yarn e2e:embed
+ run: yarn e2e:embed --workers=4
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v4
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index 65d098c438a..1141ad407b9 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -45,7 +45,7 @@ jobs:
e2e:
timeout-minutes: 20
name: E2E (${{ matrix.shard }}/${{ strategy.job-total }})
- runs-on: buildjet-8vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
image: postgres:13
@@ -87,7 +87,7 @@ jobs:
- uses: ./.github/actions/cache-db
- uses: ./.github/actions/cache-build
- name: Run Tests
- run: yarn e2e --shard=${{ matrix.shard }}/${{ strategy.job-total }}
+ run: yarn e2e --shard=${{ matrix.shard }}/${{ strategy.job-total }} --workers=4
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml
index b3118bc5b27..17254de7d8d 100644
--- a/.github/workflows/i18n.yml
+++ b/.github/workflows/i18n.yml
@@ -10,7 +10,7 @@ concurrency:
jobs:
i18n:
name: Run i18n
- runs-on: buildjet-2vcpu-ubuntu-2204
+ runs-on: blacksmith-2vcpu-ubuntu-2404
permissions:
actions: write
contents: write
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
index 140d7101794..6226885a66e 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -45,7 +45,7 @@ jobs:
integration:
timeout-minutes: 20
name: Integration
- runs-on: buildjet-8vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
services:
postgres:
image: postgres:13
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 1ddaccfc2f1..e9b285a8ac7 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -6,7 +6,7 @@ permissions:
contents: read
jobs:
lint:
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/nextjs-bundle-analysis-annotation.yml b/.github/workflows/nextjs-bundle-analysis-annotation.yml
index 55936044325..fa686e10c70 100644
--- a/.github/workflows/nextjs-bundle-analysis-annotation.yml
+++ b/.github/workflows/nextjs-bundle-analysis-annotation.yml
@@ -12,7 +12,7 @@ permissions:
jobs:
annotate:
if: always()
- runs-on: buildjet-2vcpu-ubuntu-2204
+ runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/yarn-install
diff --git a/.github/workflows/nextjs-bundle-analysis.yml b/.github/workflows/nextjs-bundle-analysis.yml
index 9b2b2501b3f..4994356517b 100644
--- a/.github/workflows/nextjs-bundle-analysis.yml
+++ b/.github/workflows/nextjs-bundle-analysis.yml
@@ -49,7 +49,7 @@ env:
jobs:
analyze:
if: always()
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index 03bda287f0c..35d9bf182fe 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -20,7 +20,7 @@ concurrency:
jobs:
prepare:
name: Prepare
- runs-on: buildjet-2vcpu-ubuntu-2204
+ runs-on: blacksmith-2vcpu-ubuntu-2404
permissions:
pull-requests: read
outputs:
@@ -277,7 +277,7 @@ jobs:
e2e-app-store,
]
if: always()
- runs-on: buildjet-2vcpu-ubuntu-2204
+ runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: fail if conditional jobs failed
run: exit 1
diff --git a/.github/workflows/production-build-without-database.yml b/.github/workflows/production-build-without-database.yml
index 0e06eac26ea..c27f0298d2c 100644
--- a/.github/workflows/production-build-without-database.yml
+++ b/.github/workflows/production-build-without-database.yml
@@ -38,7 +38,7 @@ env:
jobs:
build:
name: Build Web App
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/release-docker.yaml b/.github/workflows/release-docker.yaml
index d695355d5ce..dbc172deeab 100644
--- a/.github/workflows/release-docker.yaml
+++ b/.github/workflows/release-docker.yaml
@@ -19,7 +19,7 @@ on:
jobs:
release-amd64:
name: "Release AMD64"
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: checkout
uses: actions/checkout@v4
diff --git a/.github/workflows/setup-db.yml b/.github/workflows/setup-db.yml
index 53a29936eee..468dbbabbd7 100644
--- a/.github/workflows/setup-db.yml
+++ b/.github/workflows/setup-db.yml
@@ -26,7 +26,7 @@ env:
jobs:
setup-db:
name: Setup Database
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 15
services:
postgres:
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
index aa5cbb0e546..4d78faf507d 100644
--- a/.github/workflows/unit-tests.yml
+++ b/.github/workflows/unit-tests.yml
@@ -9,7 +9,7 @@ jobs:
test:
name: Unit
timeout-minutes: 20
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/dangerous-git-checkout
diff --git a/.github/workflows/yarn-install.yml b/.github/workflows/yarn-install.yml
index 6909eb95f23..80bd0fe5da5 100644
--- a/.github/workflows/yarn-install.yml
+++ b/.github/workflows/yarn-install.yml
@@ -9,7 +9,7 @@ permissions:
jobs:
setup:
name: Yarn install & cache
- runs-on: buildjet-4vcpu-ubuntu-2204
+ runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
diff --git a/apps/web/playwright/icons.e2e.ts b/apps/web/playwright/icons.e2e.ts
index f5c460f17da..15575c18208 100644
--- a/apps/web/playwright/icons.e2e.ts
+++ b/apps/web/playwright/icons.e2e.ts
@@ -2,15 +2,19 @@ import { expect } from "@playwright/test";
import { test } from "./lib/fixtures";
-// Set a consistent viewport size across all environments
+// Set a consistent viewport size and device scale factor across all environments
+// to reduce screenshot flakiness due to rendering differences between CI runners
test.use({
viewport: { width: 1265, height: 1464 }, // Match the expected dimensions
+ deviceScaleFactor: 1, // Ensure consistent rendering across different environments
});
test("Icons render properly", async ({ page }) => {
await page.goto("/icons");
await expect(page).toHaveScreenshot("icons.png", {
- maxDiffPixelRatio: 0.05,
+ // Increased threshold slightly (from 0.05 to 0.07) to account for minor
+ // rendering differences between CI runners (e.g., font antialiasing)
+ maxDiffPixelRatio: 0.07,
fullPage: true,
});
});
diff --git a/packages/features/ee/managed-event-types/reassignment/managedEventManualReassignment.integration-test.ts b/packages/features/ee/managed-event-types/reassignment/managedEventManualReassignment.integration-test.ts
index 69b8480c7f6..abc9ad518f1 100644
--- a/packages/features/ee/managed-event-types/reassignment/managedEventManualReassignment.integration-test.ts
+++ b/packages/features/ee/managed-event-types/reassignment/managedEventManualReassignment.integration-test.ts
@@ -131,22 +131,31 @@ beforeAll(async () => {
});
afterEach(async () => {
- // Clean up bookings
- if (bookingIds.length > 0) {
- await prisma.bookingReference.deleteMany({
- where: { bookingId: { in: bookingIds } },
- });
- await prisma.attendee.deleteMany({
- where: { bookingId: { in: bookingIds } },
- });
- await prisma.assignmentReason.deleteMany({
- where: { bookingId: { in: bookingIds } },
- });
- await prisma.booking.deleteMany({
- where: { id: { in: bookingIds } },
+ // Clean up ALL bookings associated with test event types (including those created by reassignment)
+ // This is more robust than tracking bookingIds since it catches indirectly created bookings
+ if (eventTypeIds.length > 0) {
+ const allBookings = await prisma.booking.findMany({
+ where: { eventTypeId: { in: eventTypeIds } },
+ select: { id: true },
});
- bookingIds.splice(0, bookingIds.length);
+ const allBookingIds = allBookings.map((b) => b.id);
+
+ if (allBookingIds.length > 0) {
+ await prisma.bookingReference.deleteMany({
+ where: { bookingId: { in: allBookingIds } },
+ });
+ await prisma.attendee.deleteMany({
+ where: { bookingId: { in: allBookingIds } },
+ });
+ await prisma.assignmentReason.deleteMany({
+ where: { bookingId: { in: allBookingIds } },
+ });
+ await prisma.booking.deleteMany({
+ where: { id: { in: allBookingIds } },
+ });
+ }
}
+ bookingIds.splice(0, bookingIds.length);
// Clean up event types
if (eventTypeIds.length > 0) {
@@ -255,12 +264,6 @@ describe("managedEventManualReassignment - Integration Tests", () => {
it("should record assignment reason for manual reassignment", async () => {
const managedEventManualReassignment = (await import("./managedEventManualReassignment")).default;
- await prisma.booking.deleteMany({
- where: {
- idempotencyKey: { startsWith: "test-idempotency-" },
- },
- });
-
const originalUser = await createTestUser({
name: "Original User 2",
@@ -330,12 +333,6 @@ describe("managedEventManualReassignment - Integration Tests", () => {
it("should preserve booking details (attendees, time) during reassignment", async () => {
const managedEventManualReassignment = (await import("./managedEventManualReassignment")).default;
- await prisma.booking.deleteMany({
- where: {
- idempotencyKey: { startsWith: "test-idempotency-" },
- },
- });
-
const originalUser = await createTestUser({
name: "Original User 3",