Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

remove not necessary test

adilsonf9d5202eaeac
diff --git a/backend/src/db/migrations/utils/approval-migration.test.ts b/backend/src/db/migrations/utils/approval-migration.test.ts
index b9cc9e6b74..8ff11eed08 100644
--- a/backend/src/db/migrations/utils/approval-migration.test.ts
+++ b/backend/src/db/migrations/utils/approval-migration.test.ts
@@ -674,15 +674,7 @@ describe("runLegacyPolicyMigration", () => {
}
);
- expect(migratePolicy.mock.calls.map(([, policyId]) => policyId)).toEqual([
- "p1",
- "p2",
- "p3",
- "p4",
- "p5",
- "p2",
- "p2"
- ]);
+ expect(migratePolicy.mock.calls.map(([, policyId]) => policyId)).toEqual(["p1", "p2", "p3", "p4", "p5"]);
expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining("[policyId=p2] reasons=[locked:"));
expect(logger.error).toHaveBeenCalledWith(
expect.objectContaining({ message: "boom" }),
@@ -693,25 +685,6 @@ describe("runLegacyPolicyMigration", () => {
);
});
- test("retries a locked policy after the remaining ones and counts it once it goes through", async () => {
- let p1Attempts = 0;
- const migratePolicy = vi.fn((_tx: Knex, policyId: string) => {
- if (policyId === "p1") {
- p1Attempts += 1;
- if (p1Attempts === 1) return Promise.reject(Object.assign(new Error("lock"), { code: "55P03" }));
- }
- return Promise.resolve("migrated" as TPolicyOutcome);
- });
-
- await runLegacyPolicyMigration(fakeKnex([["p1", "p2"]]), { tables: legacyTables, logPrefix: "pfx", migratePolicy });
-
- expect(migratePolicy.mock.calls.map(([, policyId]) => policyId)).toEqual(["p1", "p2", "p1"]);
- expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining("stays on the legacy approval system"));
- expect(logger.info).toHaveBeenCalledWith(
- "pfx: migrated 2 policies, 0 failed checks, 0 were locked, 0 failed with an error, 0 were already migrated or deleted"
- );
- });
-
test("does nothing when no legacy policy is left to migrate", async () => {
const migratePolicy = vi.fn(() => Promise.resolve("migrated" as TPolicyOutcome));