chore(repo): use same cleanup function for lerna e2e (#14747)
This commit is contained in:
parent
c23b74ef89
commit
8614f3ac62
@ -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', () => {
|
||||
|
||||
@ -511,18 +511,15 @@ export async function killPorts(port?: number): Promise<boolean> {
|
||||
}
|
||||
|
||||
// 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
|
||||
if (!skipReset) {
|
||||
runCLI('reset', opts);
|
||||
try {
|
||||
removeSync(tmpProjPath());
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
export function cleanupLernaWorkspace() {
|
||||
if (isCI) {
|
||||
try {
|
||||
removeSync(tmpProjPath());
|
||||
} catch (e) {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user