Skip to content

Commit e677253

Browse files
authored
[e2e] Always attach and remove logs after every test (#994)
Original design was to handle test interaction. This is no longer a priority, and logs may simply be concatenated by timestamp.
1 parent 5cfb960 commit e677253

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tests/integration/testEnvironment.ts

+6
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ export class TestEnvironment implements AsyncDisposable {
121121
await rm(this.defaultInstallLocation, { recursive: true, force: true });
122122
}
123123

124+
async deleteLogsIfPresent() {
125+
assertPlaywrightEnabled();
126+
await rm(this.mainLogPath, { force: true });
127+
await rm(this.comfyuiLogPath, { force: true });
128+
}
129+
124130
async [Symbol.asyncDispose]() {
125131
await this.restoreInstallPath();
126132
await this.restoreVenv();

tests/integration/testExtensions.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ export const test = baseTest.extend<DesktopTestOptions & DesktopTestFixtures>({
5959
app.shouldDisposeTestEnvironment = disposeTestEnvironment;
6060
await use(app);
6161

62-
if (!disposeTestEnvironment) return;
63-
6462
// Attach logs after test
65-
await attachIfExists(testInfo, app.testEnvironment.mainLogPath);
66-
await attachIfExists(testInfo, app.testEnvironment.comfyuiLogPath);
63+
const testEnv = app.testEnvironment;
64+
await attachIfExists(testInfo, testEnv.mainLogPath);
65+
await attachIfExists(testInfo, testEnv.comfyuiLogPath);
66+
67+
// Delete logs if present
68+
await testEnv.deleteLogsIfPresent();
6769
},
6870
window: async ({ app }, use, testInfo) => {
6971
const window = await app.firstWindow();

0 commit comments

Comments
 (0)