Skip to content

Commit c54b2f5

Browse files
committed
unbreak startup tests
1 parent 7a36319 commit c54b2f5

File tree

10 files changed

+62
-9
lines changed

10 files changed

+62
-9
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "lsp-startup",
3+
"kind": "startup",
4+
"args": [
5+
"tsgo",
6+
"--lsp",
7+
"--stdio",
8+
"--disableAutomaticTypingAcquisition"
9+
]
10+
}

cases/scenarios/tsc-startup/scenario.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "tsc-startup",
33
"kind": "startup",
44
"args": [
5-
"tsc.js",
5+
"tsc",
66
"--version"
77
]
88
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "tsgo-startup",
3+
"kind": "startup",
4+
"args": [
5+
"tsgo",
6+
"tsc",
7+
"--version"
8+
]
9+
}

cases/scenarios/tsserver-startup/scenario.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "tsserver-startup",
33
"kind": "startup",
44
"args": [
5-
"tsserver.js",
5+
"tsserver",
66
"--disableAutomaticTypingAcquisition"
77
]
88
}

cases/scenarios/tsserverlibrary-startup/scenario.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "tsserverlibrary-startup",
33
"kind": "startup",
44
"args": [
5-
"tsserverlibrary.js"
5+
"tsserverlibrary"
66
]
77
}

cases/scenarios/typescript-startup/scenario.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "typescript-startup",
33
"kind": "startup",
44
"args": [
5-
"typescript.js"
5+
"typescript"
66
]
77
}

scripts/src/setupPipeline.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,21 @@ const allScenarios: readonly BaseScenario[] = [
145145
cost: 17,
146146
},
147147
{ kind: "startup", name: "tsc-startup", agent: "ts-perf1", runIn: RunType.Any, cost: 19 },
148+
{ kind: "startup", name: "tsgo-startup", agent: "ts-perf1", runIn: RunType.Any, cost: 19 },
148149
{
149150
kind: "startup",
150151
name: "tsserver-startup",
151152
agent: "ts-perf2",
152153
runIn: RunType.Any,
153154
cost: 28,
154155
},
156+
{
157+
kind: "startup",
158+
name: "lsp-startup",
159+
agent: "ts-perf2",
160+
runIn: RunType.Any,
161+
cost: 28,
162+
},
155163
{
156164
kind: "startup",
157165
name: "tsserverlibrary-startup",
@@ -446,6 +454,23 @@ function* transformPreset(parameters: Parameters, iter: Iterable<Scenario>, tsgo
446454
if (!tsgo && scenario.kind === "lsp") {
447455
continue;
448456
}
457+
if (scenario.kind === "startup") {
458+
switch (scenario.name) {
459+
case "tsc-startup":
460+
case "lsp-startup":
461+
if (tsgo) {
462+
continue;
463+
}
464+
break;
465+
case "tsgo-startup":
466+
case "tsserver-startup":
467+
case "tsserverlibrary-startup":
468+
case "typescript-startup":
469+
if (!tsgo) {
470+
continue;
471+
}
472+
}
473+
}
449474
const scenarioHosts = tsgo ? [hosts.native] : (parameters.hosts ?? [scenario.host]);
450475

451476
for (const host of scenarioHosts) {

ts-perf/packages/commands/src/benchmark/measure.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,15 +506,20 @@ async function runStartupScenario(
506506
const temp = await getTempDirectories();
507507
const expansion = ExpansionProvider.getProviders({ runner: { kind: "startup", options }, temp, scenario, host });
508508

509-
const entrypoint = scenario.args[0]; // A name of a JS file in the built/local directory.
509+
const entrypoint = resolveBuiltPath(
510+
options.builtDir,
511+
scenario.args[0], // name of JS file or executable in the built/local directory.
512+
);
513+
514+
console.log(entrypoint);
510515
const argsBuilder = new CommandLineArgumentsBuilder(
511516
expansion,
512-
host,
517+
isNativeBinary(entrypoint) ? Host.current : (host.executableFile ? host : Host.current),
513518
/*exposeGc*/ false,
514519
options.cpus,
515520
options.predictable,
516521
)
517-
.add(path.join(options.builtDir, entrypoint))
522+
.add(entrypoint)
518523
.addRange(scenario.args.slice(1));
519524

520525
const { cmd, args } = argsBuilder;

ts-perf/packages/commands/src/benchmark/print/console/benchmark.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export function printBenchmark(benchmark: Benchmark, options: BenchmarkOptions,
2626
rowStyles: [
2727
"*",
2828
{ className: "group header", border: Border.single.updateFrom({ top: "double" }) },
29-
{ className: "body", match: (x: MeasurementPivot) => x.metric === "Config Time", border: { top: "single" } },
29+
{
30+
className: "body",
31+
match: (x: MeasurementPivot) => x.metric === "Config Time",
32+
border: { top: "single" },
33+
},
3034
{ className: "body", match: (x: MeasurementPivot) => x.metric === "Total Time", border: { top: "single" } },
3135
{
3236
className: "body",

ts-perf/packages/commands/src/benchmark/print/console/comparison.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function printComparison(
104104
},
105105
{
106106
className: "body",
107-
match: (x: MeasurementComparisonPivot) => x.metric === "Config Time"||x.metric === "Parse Time",
107+
match: (x: MeasurementComparisonPivot) => x.metric === "Config Time" || x.metric === "Parse Time",
108108
border: { top: "single" },
109109
},
110110
{

0 commit comments

Comments
 (0)