Skip to content

Commit

Permalink
cherry-pick(#30202): do not run setup tasks on test run via server
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Apr 1, 2024
1 parent 0889736 commit 6b94231
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
29 changes: 15 additions & 14 deletions packages/playwright/src/isomorphic/testTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down Expand Up @@ -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');
1 change: 0 additions & 1 deletion packages/playwright/src/runner/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6b94231

Please sign in to comment.