Skip to content

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

final fixes

Daniel Hougaarde173ff3828a2
diff --git a/.github/workflows/run-backend-tests.yml b/.github/workflows/run-backend-tests.yml
index 413ed0ebf0..afa87a6cbd 100644
--- a/.github/workflows/run-backend-tests.yml
+++ b/.github/workflows/run-backend-tests.yml
@@ -44,9 +44,6 @@ jobs:
working-directory: backend
- name: Start postgres and redis
run: touch .env && docker compose -f docker-compose.dev.yml up -d db redis
- - name: Login to Oracle Container Registry
- run: echo "${{ secrets.ORACLE_DOCKER_REGISTRY_PASSWORD }}" | docker login container-registry.oracle.com -u "${{ secrets.ORACLE_DOCKER_REGISTRY_USERNAME }}" --password-stdin
-
- name: Start Secret Rotation testing databases
run: docker compose -f docker-compose.e2e-dbs.yml up -d --wait --wait-timeout 300
- name: Run unit test
@@ -56,6 +53,9 @@ jobs:
run: npm run test:e2e
working-directory: backend
env:
+ E2E_TEST_ORACLE_DB_HOST: ${{ secrets.E2E_TEST_ORACLE_DB_HOST }}
+ E2E_TEST_ORACLE_DB_USERNAME: ${{ secrets.E2E_TEST_ORACLE_DB_USERNAME }}
+ E2E_TEST_ORACLE_DB_PASSWORD: ${{ secrets.E2E_TEST_ORACLE_DB_PASSWORD }}
REDIS_URL: redis://172.17.0.1:6379
DB_CONNECTION_URI: postgres://infisical:[email protected]:5432/infisical?sslmode=disable
AUTH_SECRET: something-random
diff --git a/backend/e2e-test/routes/v3/secret-rotations.spec.ts b/backend/e2e-test/routes/v3/secret-rotations.spec.ts
index f053eae705..0dc9a4b137 100644
--- a/backend/e2e-test/routes/v3/secret-rotations.spec.ts
+++ b/backend/e2e-test/routes/v3/secret-rotations.spec.ts
@@ -538,6 +538,7 @@ describe("Secret Rotations", async () => {
{
type: SecretRotationType.OracleDb,
name: "OracleDB (19.3) Secret Rotation",
+ skippable: true,
dbCredentials: {
password: process.env.E2E_TEST_ORACLE_DB_PASSWORD!,
host: process.env.E2E_TEST_ORACLE_DB_HOST!,
@@ -628,6 +629,7 @@ describe("Secret Rotations", async () => {
]
}
] as {
+ skippable?: boolean;
type: SecretRotationType;
name: string;
dbCredentials: TGenericSqlCredentials;
@@ -660,47 +662,65 @@ describe("Secret Rotations", async () => {
}
});
- test.concurrent.each(testCases)(
- "Create secret rotation for $name",
- async ({ dbCredentials, secretMapping, userCredentials, type }) => {
- const appConnectionId = await createAppConnectionMap[type](dbCredentials);
-
- if (appConnectionId) {
- appConnectionIds.push({ id: appConnectionId, type });
+ testCases.forEach(({ skippable, dbCredentials, secretMapping, userCredentials, type, name }) => {
+ const shouldSkip = () => {
+ if (skippable) {
+ if (type === SecretRotationType.OracleDb) {
+ if (!process.env.E2E_TEST_ORACLE_DB_HOST) {
+ return true;
+ }
+ }
}
- const res = await createRotationMap[type](appConnectionId, dbCredentials, userCredentials, secretMapping);
+ return false;
+ };
- const resJson = JSON.parse(res.payload);
+ if (shouldSkip()) {
+ test.skip(`Skipping Secret Rotation for ${type} (${name}) because E2E_TEST_ORACLE_DB_HOST is not set`);
+ } else {
+ test.concurrent(
+ `Create secret rotation for ${name}`,
+ async () => {
+ const appConnectionId = await createAppConnectionMap[type](dbCredentials);
- if (resJson.secretRotation) {
- secretRotationIds.push({ id: resJson.secretRotation.id, type });
- }
+ if (appConnectionId) {
+ appConnectionIds.push({ id: appConnectionId, type });
+ }
- const startSecretValue = await getSecretValue(secretMapping.password);
- expect(startSecretValue).toBeDefined();
+ const res = await createRotationMap[type](appConnectionId, dbCredentials, userCredentials, secretMapping);
- let attempts = 0;
- while (attempts < 60) {
- const currentSecretValue = await getSecretValue(secretMapping.password);
+ const resJson = JSON.parse(res.payload);
- if (currentSecretValue !== startSecretValue) {
- break;
- }
+ if (resJson.secretRotation) {
+ secretRotationIds.push({ id: resJson.secretRotation.id, type });
+ }
- attempts += 1;
- await new Promise((resolve) => setTimeout(resolve, 2_500));
- }
+ const startSecretValue = await getSecretValue(secretMapping.password);
+ expect(startSecretValue).toBeDefined();
- if (attempts >= 60) {
- throw new Error("Secret rotation failed to rotate after 60 attempts");
- }
+ let attempts = 0;
+ while (attempts < 60) {
+ const currentSecretValue = await getSecretValue(secretMapping.password);
- const finalSecretValue = await getSecretValue(secretMapping.password);
- expect(finalSecretValue).not.toBe(startSecretValue);
- },
- {
- timeout: 300_000
+ if (currentSecretValue !== startSecretValue) {
+ break;
+ }
+
+ attempts += 1;
+ await new Promise((resolve) => setTimeout(resolve, 2_500));
+ }
+
+ if (attempts >= 60) {
+ throw new Error("Secret rotation failed to rotate after 60 attempts");
+ }
+
+ const finalSecretValue = await getSecretValue(secretMapping.password);
+ expect(finalSecretValue).not.toBe(startSecretValue);
+ },
+ {
+ timeout: 300_000
+ }
+ );
}
- );
+ });
});
diff --git a/backend/vitest.e2e.config.ts b/backend/vitest.e2e.config.ts
index 4c4680cb0e..7584e6c9c9 100644
--- a/backend/vitest.e2e.config.ts
+++ b/backend/vitest.e2e.config.ts
@@ -11,7 +11,7 @@ export default defineConfig({
E2E_TEST_ORACLE_DB_PASSWORD: process.env.E2E_TEST_ORACLE_DB_PASSWORD!
},
environment: "./e2e-test/vitest-environment-knex.ts",
- include: ["./e2e-test/**/secret-rotations.spec.ts"],
+ include: ["./e2e-test/**/*.spec.ts"],
poolOptions: {
threads: {
singleThread: true,