chore: enable CLI args filtering and support multiple benchmark classes - #14
chore: enable CLI args filtering and support multiple benchmark classes#14sdwck wants to merge 1 commit into
Conversation
|
Thanks for splitting this out. Tested it on our CI runner (non-interactive), and unfortunately BenchmarkSwitcher.Run(args, config) with empty args doesn't run anything — it just prints the "select a benchmark" prompt and exits, since there's no stdin to read from on a CI runner: Available Benchmark: Our workflow calls Could you make it default to running everything when no args are passed? Something like: if (args.Length == 0)
{
BenchmarkSwitcher.FromAssembly(typeof(StringExtensionBenchmark).Assembly).Run(new[] { "--filter", "*" }, config);
}
else
{
BenchmarkSwitcher.FromAssembly(typeof(StringExtensionBenchmark).Assembly).Run(args, config);
}That keeps the CLI filtering benefit for local use while keeping CI behavior identical to what it was before this PR. Happy to merge once that's confirmed working. |
|
Hey! My bad, accidentally deleted my fork while doing some repository cleanup and it auto-closed the PR. Feel free to just copy paste your if/else snippet and push it to master, it's a great fix, and thanks for the code review! |
Extracted this change into its own PR.
This replaces Benchmark.Run with Benchmark.FromAssembly.
This brings 2 DX improvements:
dotnet run -c Release --project Benchmarks -- --filter *RemoveCharacters*