diff --git a/scripts/costly-tests.js b/scripts/costly-tests.js index 8fea7765207..a0ee64a6bec 100644 --- a/scripts/costly-tests.js +++ b/scripts/costly-tests.js @@ -25,7 +25,6 @@ async function main() { const percentTime = perf[k] / totalTime const percentHits = (1 + (edits[otherk] || 0)) / totalEdits const cost = 5 + Math.log(percentTime / percentHits) - // TODO: Write counts instead of numbers to make JSON file smaller data.push({ name: otherk, time: perf[k], edits: 1 + (edits[otherk] || 0), cost}) if (edits[otherk]) i++ @@ -36,7 +35,7 @@ async function main() { data: data.sort((x,y) => y.cost - x.cost).map(x => ({ ...x, cost: x.cost.toFixed(2) })) } - fs.writeFileSync('.test-cost.json', JSON.stringify(output), 'utf8') + fs.writeFileSync('tests/.test-cost.json', JSON.stringify(output), 'utf8') } main().catch(e => { diff --git a/src/testRunner/parallel/host.ts b/src/testRunner/parallel/host.ts index e7d40130a90..7780cfbd646 100644 --- a/src/testRunner/parallel/host.ts +++ b/src/testRunner/parallel/host.ts @@ -193,8 +193,8 @@ namespace Harness.Parallel.Host { } function skipCostlyTests(tasks: Task[]) { - if (statSync(".test-cost.json")) { - const costs = JSON.parse(readFileSync(".test-cost.json", "utf8")) as { + if (statSync("tests/.test-cost.json")) { + const costs = JSON.parse(readFileSync("tests/.test-cost.json", "utf8")) as { totalTime: number, totalEdits: number, data: { name: string, time: number, edits: number, costs: number }[] @@ -208,7 +208,7 @@ namespace Harness.Parallel.Host { skippedTime += costs.data[i].time; skippedTests.add(costs.data[i].name); } - console.log(`Skipped ${i} expensive tests; estimated time savings of ${(skippedTime / costs.totalTime * 100).toFixed(2)}% with ${skipPercent.toFixed(2)}% chance of missing a test.`); + console.log(`Skipped ${i} expensive tests; estimated time savings of ${(skippedTime / costs.totalTime * 100).toFixed(2)}% with --skipPercent=${skipPercent.toFixed(2)} chance of missing a test.`); return tasks.filter(t => !skippedTests.has(t.file)); } else { diff --git a/.test-cost.json b/tests/.test-cost.json similarity index 100% rename from .test-cost.json rename to tests/.test-cost.json