test: 💍 update e2e tests with afterEach cleanup (#2677)

This commit is contained in:
hashicc authored and GitHub committed 2025-02-12 10:16:44 -05:00
1 parent e8cc22879f
commit 6d4768272a
7 files changed
+30 -20

No files matched your search

@@ -25,11 +25,13 @@ test.beforeAll(async () => {
});
test.beforeEach(async ({ page }) => {
await page.goto('/');
});
test.afterEach(() => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
execSync(`vault secrets disable ${secretsPath}`);
await page.goto('/');
});
test('Vault Credential Store (User & Key Pair) @ent @aws @docker', async ({
@@ -28,12 +28,14 @@ test.beforeAll(async () => {
});
test.beforeEach(async ({ page }) => {
await page.goto('/');
});
test.afterEach(() => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
execSync(`vault secrets disable ${secretsPath}`);
await page.goto('/');
});
})
test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({
page,
@@ -27,8 +27,6 @@ test.beforeAll(async () => {
test.beforeEach(
async ({ baseURL, adminAuthMethodId, adminLoginName, adminPassword }) => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
@@ -38,6 +36,11 @@ test.beforeEach(
},
);
test.afterEach(() => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
})
test('Verify resources can be deleted (enterprise) @ent @aws', async ({
page,
awsRegion,
@@ -27,8 +27,6 @@ test.beforeAll(async () => {
test.beforeEach(
async ({ baseURL, adminAuthMethodId, adminLoginName, adminPassword }) => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
await boundaryCli.authenticateBoundary(
baseURL,
adminAuthMethodId,
@@ -38,6 +36,11 @@ test.beforeEach(
},
);
test.afterEach(() => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
});
test('Verify resources can be deleted @ce @aws', async ({
page,
awsRegion,
@@ -26,8 +26,10 @@ test.beforeAll(async () => {
await vaultCli.checkVaultCli();
});
test.beforeEach(async () => {
test.afterEach(async () => {
execSync(`vault secrets disable ${secretsPath}`);
execSync(`vault policy delete ${sshPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
});
test('SSH Certificate Injection @ent @docker', async ({
@@ -143,9 +145,5 @@ test('SSH Certificate Injection @ent @docker', async ({
if (orgId) {
await boundaryCli.deleteScope(orgId);
}
execSync(`vault secrets disable ${secretsPath}`);
execSync(`vault policy delete ${sshPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
}
});
@@ -25,11 +25,13 @@ test.beforeAll(async () => {
});
test.beforeEach(async ({ page }) => {
await page.goto('/');
});
test.afterEach(() => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
execSync(`vault secrets disable ${secretsPath}`);
await page.goto('/');
});
test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({
+4 -4
View File
@@ -43,10 +43,6 @@ test.beforeEach(
sshKeyPath,
vaultAddr,
}) => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
execSync(`vault secrets disable ${secretsPath}`);
org = await boundaryHttp.createOrg(request);
const project = await boundaryHttp.createProject(request, org.id);
@@ -198,6 +194,10 @@ test.beforeEach(
);
test.afterEach(async ({ request }) => {
execSync(`vault policy delete ${secretPolicyName}`);
execSync(`vault policy delete ${boundaryPolicyName}`);
execSync(`vault secrets disable ${secretsPath}`);
if (org) {
await boundaryHttp.deleteOrg(request, org.id);
}