Skip to content

Commit f256477

Browse files
committed
tests: remove unnecessary cleanup step
since all assistants have unique names the cleanup should not be necessary existing buckets will not be created a second time this is a step on the way to parallel test execution
1 parent ee7eff3 commit f256477

File tree

7 files changed

+11
-19
lines changed

7 files changed

+11
-19
lines changed

e2e/extension-tests/azure-open-ai-assistant-change.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { config } from '../tests/utils/config';
33
import {
44
addAzureModelToConfiguration,
55
addSystemPromptToConfiguration,
6-
cleanup,
76
createConfiguration,
87
deleteConfiguration,
98
disableConfiguration,
@@ -24,7 +23,6 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
2423

2524
await test.step('should login', async () => {
2625
await login(page);
27-
await cleanup(page);
2826
});
2927
await test.step('should add two assistants', async () => {
3028
await enterAdminArea(page);

e2e/extension-tests/azure-open-ai-new-chat.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { config } from '../tests/utils/config';
44
import {
55
addAzureModelToConfiguration,
66
checkSelectedConfiguration,
7-
cleanup,
87
createConfiguration,
98
enterAdminArea,
109
enterUserArea,
@@ -23,7 +22,6 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
2322
const configuration = { name: '', description: '' };
2423
await test.step('should login', async () => {
2524
await login(page);
26-
await cleanup(page);
2725
});
2826

2927
await test.step('add assistant', async () => {

e2e/extension-tests/azure-open-ai-search-file-in-chat.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import {
44
addAzureModelToConfiguration,
55
addFilesInChatExtensionToConfiguration,
66
addSystemPromptToConfiguration,
7-
cleanup,
8-
createBucket,
7+
createBucketIfNotExist,
98
createConfiguration,
109
deleteFirstFileFromPaperclip,
1110
duplicateLastCreatedConversation,
@@ -31,7 +30,6 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
3130

3231
await test.step('should login', async () => {
3332
await login(page);
34-
await cleanup(page);
3533
});
3634

3735
await test.step('add assistant', async () => {
@@ -41,7 +39,7 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
4139
await createConfiguration(page, configuration);
4240
await addAzureModelToConfiguration(page, configuration, { deployment: 'gpt-4o-mini' });
4341
await addSystemPromptToConfiguration(page, configuration, { text: 'Your are a helpful assistant.' });
44-
await createBucket(page, {
42+
await createBucketIfNotExist(page, {
4543
name: conversationFilesBucket,
4644
type: 'conversation',
4745
endpoint: config.REIS_ENDPOINT,

e2e/extension-tests/azure-open-ai-whole-file.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import {
77
addSystemPromptToConfiguration,
88
addVisionFileExtensionToConfiguration,
99
addWholeFileExtensionToConfiguration,
10-
cleanup,
11-
createBucket,
10+
createBucketIfNotExist,
1211
createConfiguration,
1312
deactivateFileInChatExtensionToConfiguration,
1413
deleteFirstFileFromPaperclip,
@@ -34,7 +33,6 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
3433

3534
await test.step('should login', async () => {
3635
await login(page);
37-
await cleanup(page);
3836
});
3937

4038
await test.step('add assistant', async () => {
@@ -53,7 +51,7 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
5351
});
5452

5553
await test.step('should add whole file extension to Assistant', async () => {
56-
await createBucket(page, {
54+
await createBucketIfNotExist(page, {
5755
name: conversationFilesBucket,
5856
type: 'conversation',
5957
endpoint: config.REIS_ENDPOINT,

e2e/extension-tests/azure-open-ai.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import {
44
addAzureModelToConfiguration,
55
addBucketToConfiguration,
66
addSystemPromptToConfiguration,
7-
cleanup,
8-
createBucket,
7+
createBucketIfNotExist,
98
createConfiguration,
109
editBucket,
1110
enterAdminArea,
@@ -28,7 +27,6 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
2827

2928
await test.step('should login', async () => {
3029
await login(page);
31-
await cleanup(page);
3230
});
3331
await test.step('should not add Configuration without required fields', async () => {
3432
await enterAdminArea(page);
@@ -108,7 +106,7 @@ if (!config.AZURE_OPEN_AI_API_KEY) {
108106

109107
await test.step('should create bucket', async () => {
110108
await enterAdminArea(page);
111-
await createBucket(page, {
109+
await createBucketIfNotExist(page, {
112110
name: bucket.name,
113111
type: 'user',
114112
endpoint: config.REIS_ENDPOINT,

e2e/extension-tests/viewport.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import test, { expect } from '@playwright/test';
22
import { sseBodyABC, sseBodyBanana } from '../tests/utils/files/sse-responses';
33
import {
44
addAzureModelToConfiguration,
5-
cleanup,
65
createConfiguration,
76
enterAdminArea,
87
enterUserArea,
@@ -44,7 +43,6 @@ test('Chat viewport scrolling', async ({ page }) => {
4443

4544
await test.step('should login', async () => {
4645
await login(page);
47-
await cleanup(page);
4846
});
4947

5048
await test.step('should add mock assistant', async () => {

e2e/tests/utils/helper.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,15 @@ export async function clearMessages(page: Page) {
146146
await confirm.waitFor({ state: 'detached' });
147147
}
148148

149-
export async function createBucket(
149+
export async function createBucketIfNotExist(
150150
page: Page,
151151
bucket: { name: string; indexName?: string; endpoint: string; type: 'user' | 'conversation' | 'general' },
152152
) {
153153
await page.getByRole('link', { name: 'Files' }).click();
154+
if (await page.locator('li').filter({ hasText: bucket.name }).getByTestId('more-actions').count()) {
155+
// Bucket already exists
156+
return;
157+
}
154158

155159
await page
156160
.locator('*')

0 commit comments

Comments
 (0)