chore(repo): use same cleanup function for lerna e2e (#14747)
This commit is contained in:
parent
c23b74ef89
commit
8614f3ac62
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
cleanupLernaWorkspace,
|
cleanupProject,
|
||||||
newLernaWorkspace,
|
newLernaWorkspace,
|
||||||
runLernaCLI,
|
runLernaCLI,
|
||||||
tmpProjPath,
|
tmpProjPath,
|
||||||
@ -32,7 +32,7 @@ expect.addSnapshotSerializer({
|
|||||||
|
|
||||||
describe('Lerna Smoke Tests', () => {
|
describe('Lerna Smoke Tests', () => {
|
||||||
beforeAll(() => newLernaWorkspace());
|
beforeAll(() => newLernaWorkspace());
|
||||||
afterAll(() => cleanupLernaWorkspace());
|
afterAll(() => cleanupProject({ skipReset: true }));
|
||||||
|
|
||||||
// `lerna repair` builds on top of `nx repair` and runs all of its generators
|
// `lerna repair` builds on top of `nx repair` and runs all of its generators
|
||||||
describe('lerna repair', () => {
|
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
|
// 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) {
|
if (isCI) {
|
||||||
// Stopping the daemon is not required for tests to pass, but it cleans up background processes
|
// Stopping the daemon is not required for tests to pass, but it cleans up background processes
|
||||||
runCLI('reset', opts);
|
if (!skipReset) {
|
||||||
try {
|
runCLI('reset', opts);
|
||||||
removeSync(tmpProjPath());
|
}
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function cleanupLernaWorkspace() {
|
|
||||||
if (isCI) {
|
|
||||||
try {
|
try {
|
||||||
removeSync(tmpProjPath());
|
removeSync(tmpProjPath());
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user