diff --git a/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts b/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts index d5abfac76b..ff5237b041 100644 --- a/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts +++ b/e2e/lerna-smoke-tests/src/lerna-smoke-tests.test.ts @@ -4,7 +4,7 @@ */ import { - cleanupLernaWorkspace, + cleanupProject, newLernaWorkspace, runLernaCLI, tmpProjPath, @@ -32,7 +32,7 @@ expect.addSnapshotSerializer({ describe('Lerna Smoke Tests', () => { beforeAll(() => newLernaWorkspace()); - afterAll(() => cleanupLernaWorkspace()); + afterAll(() => cleanupProject({ skipReset: true })); // `lerna repair` builds on top of `nx repair` and runs all of its generators describe('lerna repair', () => { diff --git a/e2e/utils/index.ts b/e2e/utils/index.ts index 65b2d1ad1e..89bd6f6080 100644 --- a/e2e/utils/index.ts +++ b/e2e/utils/index.ts @@ -511,18 +511,15 @@ export async function killPorts(port?: number): Promise { } // Useful in order to cleanup space during CI to prevent `No space left on device` exceptions -export async function cleanupProject(opts?: RunCmdOpts) { +export function cleanupProject({ + skipReset, + ...opts +}: RunCmdOpts & { skipReset?: boolean } = {}) { if (isCI) { // Stopping the daemon is not required for tests to pass, but it cleans up background processes - runCLI('reset', opts); - try { - removeSync(tmpProjPath()); - } catch (e) {} - } -} - -export function cleanupLernaWorkspace() { - if (isCI) { + if (!skipReset) { + runCLI('reset', opts); + } try { removeSync(tmpProjPath()); } catch (e) {}