feat: Add filter by UID feature by using existing --filter syntax - #3237
feat: Add filter by UID feature by using existing --filter syntax#3237filzrev wants to merge 1 commit into
Conversation
689470f to
24e30c5
Compare
adamsitnik
left a comment
There was a problem hiding this comment.
@filzrev I am trying to understand when filtering by guid is going to provide value.
Let's say that I have the BenchmarkDotNet.Tests.Filters.TypeWithBenchmarksAndParams.TheBenchmark benchmark and I want to run it.
If I use --filter BenchmarkDotNet.Tests.Filters.TypeWithBenchmarksAndParams.TheBenchmark it just works.
When I use UID I need to:
- write some code that is going to generate the unique ID using
GetUniqueId(not mentioned in samples or XML docs) - somehow store this value
- provide the value when filtering.
Now as soon as the namespace, type name, method name or any other part of the benchmark ID changes, the UID is no longer valid. So what is the advantage of using it over the typical --filter?
|
It's intended to be used for debugging purpose. ( Existing filter syntax match Example [InProcess]
[Config(typeof(DebugInProcessConfig))]
public class Benchmarks
{
[Benchmark]
public void Benchmark01() {}
}And when filtering benchmarkCase with To run specific benchmark for debugging purpose, |
Thanks. In such case I would expect the user to modify the config and just comment out the Job they don't want to use. |
This PR extend existing
--filtersyntax to support filter by UID of BenchmarkCase.By modyfing existing filter logics to use
UidFilterwhen filter text can be parsed as GUID format.Other changes
Filtersdirectory/namespace.