Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ module.exports = function (grunt) {
cmd: 'node',
args: ['tools/gen_wpt_cts_html', 'tools/gen_wpt_cfg_unchunked.json'],
},
'write-out-wpt-cts-html-chunked2sec': {
cmd: 'node',
args: ['tools/gen_wpt_cts_html', 'tools/gen_wpt_cfg_chunked2sec.json'],
},
'write-out-wpt-cts-html-withsomeworkers': {
cmd: 'node',
args: ['tools/gen_wpt_cts_html', 'tools/gen_wpt_cfg_withsomeworkers.json'],
Expand Down Expand Up @@ -203,11 +199,7 @@ module.exports = function (grunt) {

concurrent: {
'write-out-wpt-cts-html-all': {
tasks: [
'run:write-out-wpt-cts-html',
'run:write-out-wpt-cts-html-chunked2sec',
'run:write-out-wpt-cts-html-withsomeworkers',
],
tasks: ['run:write-out-wpt-cts-html', 'run:write-out-wpt-cts-html-withsomeworkers'],
},
'all-builds': {
tasks: ['build-standalone', 'build-wpt', 'run:build-out-node'],
Expand Down
148 changes: 0 additions & 148 deletions docs/adding_timing_metadata.md

This file was deleted.

29 changes: 0 additions & 29 deletions src/common/framework/metadata.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/common/internal/file_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ export abstract class TestFileLoader extends EventTarget {
{
subqueriesToExpand = [],
fullyExpandSubtrees = [],
maxChunkTime = Infinity,
}: { subqueriesToExpand?: string[]; fullyExpandSubtrees?: string[]; maxChunkTime?: number } = {}
}: { subqueriesToExpand?: string[]; fullyExpandSubtrees?: string[] } = {}
): Promise<TestTree> {
const tree = await loadTreeForQuery(this, query, {
subqueriesToExpand: subqueriesToExpand.map(s => {
Expand All @@ -84,7 +83,6 @@ export abstract class TestFileLoader extends EventTarget {
return q;
}),
fullyExpandSubtrees: fullyExpandSubtrees.map(s => parseQuery(s)),
maxChunkTime,
});
this.dispatchEvent(new MessageEvent<void>('finish'));
return tree;
Expand Down
54 changes: 6 additions & 48 deletions src/common/internal/tree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { loadMetadataForSuite, TestMetadataListing } from '../framework/metadata.js';
import { globalTestConfig } from '../framework/test_config.js';
import { RunCase, RunFn } from '../internal/test_group.js';
import { assert, now } from '../util/util.js';
Expand Down Expand Up @@ -101,21 +100,8 @@ export class TestTree {
);
}

static async create(
forQuery: TestQuery,
root: TestSubtree,
maxChunkTime: number
): Promise<TestTree> {
const suite = forQuery.suite;

let chunking = undefined;
if (Number.isFinite(maxChunkTime)) {
const metadata = loadMetadataForSuite(`./src/${suite}`);
assert(metadata !== null, `metadata for ${suite} is missing, but maxChunkTime was requested`);
chunking = { metadata, maxChunkTime };
}
await TestTree.propagateCounts(root, chunking);

static async create(forQuery: TestQuery, root: TestSubtree): Promise<TestTree> {
await TestTree.propagateCounts(root);
return new TestTree(forQuery, root);
}

Expand Down Expand Up @@ -206,14 +192,13 @@ export class TestTree {

/** Propagate the subtreeTODOs/subtreeTests state upward from leaves to parent nodes. */
static async propagateCounts(
subtree: TestSubtree,
chunking: { metadata: TestMetadataListing; maxChunkTime: number } | undefined
subtree: TestSubtree
): Promise<{ tests: number; nodesWithTODO: number; totalTimeMS: number; subcaseCount: number }> {
subtree.subtreeCounts ??= { tests: 0, nodesWithTODO: 0, totalTimeMS: 0 };
subtree.subcaseCount = 0;
for (const [, child] of subtree.children) {
if ('children' in child) {
const counts = await TestTree.propagateCounts(child, chunking);
const counts = await TestTree.propagateCounts(child);
subtree.subtreeCounts.tests += counts.tests;
subtree.subtreeCounts.nodesWithTODO += counts.nodesWithTODO;
subtree.subtreeCounts.totalTimeMS += counts.totalTimeMS;
Expand All @@ -223,32 +208,6 @@ export class TestTree {
}
}

// If we're chunking based on a maxChunkTime, then at each
// TestQueryMultiCase node of the tree we look at its total time. If the
// total time is larger than the maxChunkTime, we set collapsible=false to
// make sure it gets split up in the output. Note:
// - TestQueryMultiTest and higher nodes are never set to collapsible anyway, so we ignore them.
// - TestQuerySingleCase nodes can't be collapsed, so we ignore them.
if (chunking && subtree.query instanceof TestQueryMultiCase) {
const testLevelQuery = new TestQueryMultiCase(
subtree.query.suite,
subtree.query.filePathParts,
subtree.query.testPathParts,
{}
).toString();

const metadata = chunking.metadata;

const subcaseTiming: number | undefined = metadata[testLevelQuery]?.subcaseMS;
if (subcaseTiming !== undefined) {
const totalTiming = subcaseTiming * subtree.subcaseCount;
subtree.subtreeCounts.totalTimeMS = totalTiming;
if (totalTiming > chunking.maxChunkTime) {
subtree.collapsible = false;
}
}
}

return { ...subtree.subtreeCounts, subcaseCount: subtree.subcaseCount ?? 0 };
}

Expand Down Expand Up @@ -287,8 +246,7 @@ export async function loadTreeForQuery(
{
subqueriesToExpand,
fullyExpandSubtrees = [],
maxChunkTime = Infinity,
}: { subqueriesToExpand: TestQuery[]; fullyExpandSubtrees?: TestQuery[]; maxChunkTime?: number }
}: { subqueriesToExpand: TestQuery[]; fullyExpandSubtrees?: TestQuery[] }
): Promise<TestTree> {
const suite = queryToLoad.suite;
const specs = await loader.listing(suite);
Expand Down Expand Up @@ -454,7 +412,7 @@ export async function loadTreeForQuery(
}
assert(foundCase, `Query \`${queryToLoad.toString()}\` does not match any cases`);

return TestTree.create(queryToLoad, subtreeL0, maxChunkTime);
return TestTree.create(queryToLoad, subtreeL0);
}

function setSubtreeDescriptionAndCountTODOs(
Expand Down
Loading
Loading