Skip to content

Commit

Permalink
Resolve benchmark output path
Browse files Browse the repository at this point in the history
  • Loading branch information
fvictorio committed Aug 21, 2024
1 parent 176e83c commit 46d0eb3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions crates/tools/js/benchmark/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ async function main() {
});
const args: ParsedArguments = parser.parse_args();

// if --benchmark-output is relative, resolve it relatively to cwd
// to reduce ambiguity
const benchmarkOutputPath = path.resolve(
process.cwd(),
args.benchmark_output
);

let results: BenchmarkScenarioRpcCalls | undefined;
if (args.command === "benchmark") {
if (args.grep !== undefined) {
Expand All @@ -83,14 +90,14 @@ async function main() {
}
}
} else {
await benchmarkAllScenarios(args.benchmark_output, args.anvil);
await benchmarkAllScenarios(benchmarkOutputPath, args.anvil);
}
await flushStdout();
} else if (args.command === "verify") {
const success = await verify(args.benchmark_output);
const success = await verify(benchmarkOutputPath);
process.exit(success ? 0 : 1);
} else if (args.command === "report") {
await report(args.benchmark_output);
await report(benchmarkOutputPath);
await flushStdout();
}
}
Expand Down

0 comments on commit 46d0eb3

Please sign in to comment.