chore: do not run setup tasks on test run via server (#30202)

This commit is contained in:
Pavel Feldman 2024-04-01 15:31:09 -07:00 committed by GitHub
parent cc881fdb1f
commit 6e799fdfa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 15 deletions

View File

@ -295,20 +295,7 @@ export class TestTree {
}
collectTestIds(treeItem?: TreeItem): Set<string> {
const testIds = new Set<string>();
if (!treeItem)
return testIds;
const visit = (treeItem: TreeItem) => {
if (treeItem.kind === 'case')
treeItem.tests.map(t => t.id).forEach(id => testIds.add(id));
else if (treeItem.kind === 'test')
testIds.add(treeItem.id);
else
treeItem.children?.forEach(visit);
};
visit(treeItem);
return testIds;
return treeItem ? collectTestIds(treeItem) : new Set();
}
}
@ -349,4 +336,18 @@ export function sortAndPropagateStatus(treeItem: TreeItem) {
treeItem.status = 'passed';
}
export function collectTestIds(treeItem: TreeItem): Set<string> {
const testIds = new Set<string>();
const visit = (treeItem: TreeItem) => {
if (treeItem.kind === 'case')
treeItem.tests.map(t => t.id).forEach(id => testIds.add(id));
else if (treeItem.kind === 'test')
testIds.add(treeItem.id);
else
treeItem.children?.forEach(visit);
};
visit(treeItem);
return testIds;
}
export const statusEx = Symbol('statusEx');

View File

@ -85,7 +85,6 @@ export function createTaskRunnerForWatch(config: FullConfigInternal, reporter: R
export function createTaskRunnerForTestServer(config: FullConfigInternal, reporter: ReporterV2): TaskRunner<TestRun> {
const taskRunner = new TaskRunner<TestRun>(reporter, 0);
addGlobalSetupTasks(taskRunner, config);
taskRunner.addTask('load tests', createLoadTask('out-of-process', { filterOnly: true, failOnLoadErrors: false, doNotRunDepsOutsideProjectFilter: true }));
addRunTasks(taskRunner, config);
return taskRunner;