perform premature optimisation
This commit is contained in:
parent
338790f4af
commit
065f5ce7ec
|
|
@ -235,7 +235,7 @@ function createLoadTask(mode: 'out-of-process' | 'in-process', options: { filter
|
|||
for (const plugin of testRun.config.plugins)
|
||||
await plugin.instance?.populateDependencies?.();
|
||||
const changedFiles = await detectChangedFiles(testRun.config.cliOnlyChanged);
|
||||
cliOnlyChangedMatcher = file => changedFiles.includes(file);
|
||||
cliOnlyChangedMatcher = file => changedFiles.has(file);
|
||||
}
|
||||
|
||||
testRun.rootSuite = await createRootSuite(testRun, options.failOnLoadErrors ? errors : softErrors, !!options.filterOnly, cliOnlyChangedMatcher);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import { toPosixPath } from 'playwright-core/lib/utils';
|
|||
import { affectedTestFiles } from '../transform/compilationCache';
|
||||
import path from 'path';
|
||||
|
||||
export async function detectChangedFiles(baseCommit: string): Promise<string[]> {
|
||||
export async function detectChangedFiles(baseCommit: string): Promise<Set<string>> {
|
||||
function gitFileList(command: string) {
|
||||
try {
|
||||
return childProcess.execSync(
|
||||
|
|
@ -45,8 +45,8 @@ export async function detectChangedFiles(baseCommit: string): Promise<string[]>
|
|||
const filesWithChanges = [...untrackedFiles, ...trackedFilesWithChanges];
|
||||
const affectedFiles = affectedTestFiles(filesWithChanges);
|
||||
|
||||
return [
|
||||
return new Set([
|
||||
...filesWithChanges,
|
||||
...affectedFiles,
|
||||
].map(toPosixPath);
|
||||
].map(toPosixPath));
|
||||
}
|
||||
Loading…
Reference in a new issue