From 8665737dcbeb1dbe6f81873385afffa533c6ae3a Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 10 Jun 2024 17:18:27 +0100 Subject: [PATCH] Bringing app migration tests back. --- .../migrations/tests/20240604153647_initial_sqs.spec.ts | 2 +- .../src/appMigrations/tests/migrations.integrity.spec.ts | 4 ++-- packages/server/src/appMigrations/tests/migrations.spec.ts | 2 +- .../src/appMigrations/tests/migrationsProcessor.spec.ts | 2 +- packages/server/src/middleware/appMigrations.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts b/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts index 731f0364c3..86e50a5812 100644 --- a/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts +++ b/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts @@ -82,7 +82,7 @@ beforeAll(async () => { }) }) -describe.skip("SQS migration", () => { +describe("SQS migration", () => { it("test migration runs as expected against an older DB", async () => { const db = dbCore.getDB(config.appId!) // confirm nothing exists initially diff --git a/packages/server/src/appMigrations/tests/migrations.integrity.spec.ts b/packages/server/src/appMigrations/tests/migrations.integrity.spec.ts index 2bb4c2b4f8..145a06d7f5 100644 --- a/packages/server/src/appMigrations/tests/migrations.integrity.spec.ts +++ b/packages/server/src/appMigrations/tests/migrations.integrity.spec.ts @@ -2,10 +2,10 @@ import { context } from "@budibase/backend-core" import * as setup from "../../api/routes/tests/utilities" import * as migrations from "../migrations" -describe.skip("migration integrity", () => { +describe("migration integrity", () => { // These test is checking that each migration is "idempotent". // We should be able to rerun any migration, with any rerun not modifiying anything. The code should be aware that the migration already ran - it.skip("each migration can rerun safely", async () => { + it("each migration can rerun safely", async () => { const config = setup.getConfig() await config.init() diff --git a/packages/server/src/appMigrations/tests/migrations.spec.ts b/packages/server/src/appMigrations/tests/migrations.spec.ts index e707c9914c..1da94f503f 100644 --- a/packages/server/src/appMigrations/tests/migrations.spec.ts +++ b/packages/server/src/appMigrations/tests/migrations.spec.ts @@ -13,7 +13,7 @@ jest.mock("../migrations", () => ({ ], })) -describe.skip("migrations", () => { +describe("migrations", () => { it("new apps are created with the latest app migration version set", async () => { const config = setup.getConfig() await config.init() diff --git a/packages/server/src/appMigrations/tests/migrationsProcessor.spec.ts b/packages/server/src/appMigrations/tests/migrationsProcessor.spec.ts index b552e2bb12..a2d1dc05c3 100644 --- a/packages/server/src/appMigrations/tests/migrationsProcessor.spec.ts +++ b/packages/server/src/appMigrations/tests/migrationsProcessor.spec.ts @@ -6,7 +6,7 @@ import { AppMigration } from ".." const futureTimestamp = `20500101174029` -describe.skip("migrationsProcessor", () => { +describe("migrationsProcessor", () => { it("running migrations will update the latest applied migration", async () => { const testMigrations: AppMigration[] = [ { id: `${futureTimestamp}_123`, func: async () => {} }, diff --git a/packages/server/src/middleware/appMigrations.ts b/packages/server/src/middleware/appMigrations.ts index 9c739fb72b..6ad356427b 100644 --- a/packages/server/src/middleware/appMigrations.ts +++ b/packages/server/src/middleware/appMigrations.ts @@ -7,7 +7,7 @@ export default async (ctx: UserCtx, next: any) => { // migrations can be disabled via environment variable if you // need to completely disable migrations, e.g. for testing - if (env.DISABLE_APP_MIGRATIONS || env.isTest()) { + if (env.DISABLE_APP_MIGRATIONS) { return next() }