Compare commits

...

2 Commits

Author SHA1 Message Date
Max Kless 8b0bbfcf75 chore(repo): remove plugin isolation 2024-07-24 12:07:58 +02:00
FrozenPandaz 1170b4e73a chore(repo): debug 2024-07-24 11:27:49 +02:00
4 changed files with 48 additions and 43 deletions
+1
View File
@@ -77,6 +77,7 @@ describe('Playwright E2E Test Runner - legacy', () => {
newProject({
name: uniq('playwright'),
unsetProjectNameAndRootFormat: false,
packages: ['@nx/playwright', '@nx/web'],
});
process.env.NX_ADD_PLUGINS = 'false';
});
+16 -7
View File
@@ -351,25 +351,34 @@ export function runCLI(
const commandToRun = `${pm.runNxSilent} ${command} ${
opts.verbose ?? isVerboseE2ERun() ? ' --verbose' : ''
}${opts.redirectStderr ? ' 2>&1' : ''}`;
performance.mark(`[command] ${commandToRun} - start`);
const logs = execSync(commandToRun, {
cwd: opts.cwd || tmpProjPath(),
env: {
CI: 'true',
...getStrippedEnvironmentVariables(),
...opts.env,
NX_PERF_LOGGING: 'true',
},
encoding: 'utf-8',
stdio: 'pipe',
maxBuffer: 50 * 1024 * 1024,
});
performance.mark(`[command] ${commandToRun} - end`);
const measure = performance.measure(
`[command] ${commandToRun}`,
`[command] ${commandToRun} - start`,
`[command] ${commandToRun} - end`
);
if (opts.verbose ?? isVerboseE2ERun()) {
output.log({
title: `Original command: ${command}`,
bodyLines: [logs as string],
color: 'green',
});
}
output.log({
title: `Original command: ${command}`,
bodyLines: [
...(isVerboseE2ERun() ? [logs] : [logs]),
`${measure.name}: ${measure.duration}ms`,
],
color: 'green',
});
const r = stripConsoleColors(logs);
+31 -35
View File
@@ -104,14 +104,6 @@ export function newProject({
createNxWorkspaceEnd.name
);
if (unsetProjectNameAndRootFormat) {
console.warn(
'ATTENTION: The workspace generated for this e2e test does not use the new as-provided project name/root format. Please update this test'
);
createFile('apps/.gitkeep');
createFile('libs/.gitkeep');
}
// Temporary hack to prevent installing with `--frozen-lockfile`
if (isCI && packageManager === 'pnpm') {
updateFile(
@@ -120,19 +112,6 @@ export function newProject({
);
}
if (!packages) {
console.warn(
'ATTENTION: All packages are installed into the new workspace. To make this test faster, please pass the subset of packages that this test needs by passing a packages array in the options'
);
}
const packageInstallStart = performance.mark('packageInstall:start');
packageInstall((packages ?? nxPackages).join(` `), projScope);
const packageInstallEnd = performance.mark('packageInstall:end');
packageInstallMeasure = performance.measure(
'packageInstall',
packageInstallStart.name,
packageInstallEnd.name
);
// stop the daemon
execSync(`${getPackageManagerCommand().runNx} reset`, {
cwd: `${e2eCwd}/proj`,
@@ -146,6 +125,21 @@ export function newProject({
const projectDirectory = tmpProjPath();
copySync(`${tmpBackupProjPath()}`, `${projectDirectory}`);
if (unsetProjectNameAndRootFormat) {
console.warn(
'ATTENTION: The workspace generated for this e2e test does not use the new as-provided project name/root format. Please update this test'
);
createFile('apps/.gitkeep');
createFile('libs/.gitkeep');
}
if (!packages) {
console.warn(
'ATTENTION: All packages are installed into the new workspace. To make this test faster, please pass the subset of packages that this test needs by passing a packages array in the options'
);
}
const packageInstallStart = performance.mark('packageInstall:start');
const dependencies = readJsonFile(
`${projectDirectory}/package.json`
).devDependencies;
@@ -163,6 +157,12 @@ export function newProject({
encoding: 'utf-8',
});
}
const packageInstallEnd = performance.mark('packageInstall:end');
packageInstallMeasure = performance.measure(
'packageInstall',
packageInstallStart.name,
packageInstallEnd.name
);
const newProjectEnd = performance.mark('new-project:end');
const perfMeasure = performance.measure(
@@ -171,12 +171,11 @@ export function newProject({
newProjectEnd.name
);
if (isVerbose()) {
logInfo(
`NX`,
`E2E created a project: ${projectDirectory} in ${
perfMeasure.duration / 1000
} seconds
logInfo(
`NX`,
`E2E created a project: ${projectDirectory} in ${
perfMeasure.duration / 1000
} seconds
${
createNxWorkspaceMeasure
? `create-nx-workspace: ${
@@ -184,14 +183,11 @@ ${
} seconds\n`
: ''
}${
packageInstallMeasure
? `packageInstall: ${
packageInstallMeasure.duration / 1000
} seconds\n`
: ''
}`
);
}
packageInstallMeasure
? `packageInstall: ${packageInstallMeasure.duration / 1000} seconds\n`
: ''
}`
);
if (process.env.NX_E2E_EDITOR) {
const editor = process.env.NX_E2E_EDITOR;
-1
View File
@@ -46,7 +46,6 @@ export function isAndroid() {
process.env.ANDROID_SDK_ROOT
);
}
export const e2eRoot = isCI
? dirSync({ prefix: 'nx-e2e-' }).name
: '/tmp/nx-e2e';