[CI Visibility] - Add Intelligent Test Runner support in MSTest testing framework#3341
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| // the MethodInfo of the test | ||
| var executor = instance.TestMethodInfo.TestMethodOptions.Executor; | ||
| _customTestMethodAttribute ??= new CustomTestMethodAttribute(executor.GetType().Assembly); | ||
| instance.TestMethodInfo.TestMethodOptions.Executor = DuckType.CreateReverse(executor.GetType(), _customTestMethodAttribute); |
lucaspimentel
approved these changes
Oct 14, 2022
Member
Benchmarks Report 🐌Benchmarks for #3341 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AppSecBodyBenchmark - Faster 🎉 Same allocations ✔️
|
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net472 | 1.154 | 226.20 | 195.94 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | AllCycleSimpleBody |
net472 | 198ns | 0.169ns | 0.656ns | 0.0727 | 0 | 0 | 457 B |
| master | AllCycleSimpleBody |
netcoreapp3.1 | 268ns | 0.139ns | 0.537ns | 0.00619 | 0 | 0 | 456 B |
| master | AllCycleMoreComplexBody |
net472 | 226ns | 0.318ns | 1.19ns | 0.0688 | 0 | 0 | 433 B |
| master | AllCycleMoreComplexBody |
netcoreapp3.1 | 253ns | 0.133ns | 0.499ns | 0.00592 | 0 | 0 | 432 B |
| master | BodyExtractorSimpleBody |
net472 | 276ns | 0.317ns | 1.23ns | 0.0574 | 0 | 0 | 361 B |
| master | BodyExtractorSimpleBody |
netcoreapp3.1 | 245ns | 0.147ns | 0.55ns | 0.0037 | 0 | 0 | 272 B |
| master | BodyExtractorMoreComplexBody |
net472 | 15.6μs | 8.36ns | 30.2ns | 1.21 | 0.0157 | 0 | 7.62 KB |
| master | BodyExtractorMoreComplexBody |
netcoreapp3.1 | 12.5μs | 4.78ns | 18.5ns | 0.087 | 0 | 0 | 6.75 KB |
| #3341 | AllCycleSimpleBody |
net472 | 197ns | 0.059ns | 0.221ns | 0.0726 | 0 | 0 | 457 B |
| #3341 | AllCycleSimpleBody |
netcoreapp3.1 | 254ns | 0.372ns | 1.44ns | 0.00626 | 0 | 0 | 456 B |
| #3341 | AllCycleMoreComplexBody |
net472 | 196ns | 0.0368ns | 0.133ns | 0.0688 | 0 | 0 | 433 B |
| #3341 | AllCycleMoreComplexBody |
netcoreapp3.1 | 255ns | 0.621ns | 2.32ns | 0.00593 | 0 | 0 | 432 B |
| #3341 | BodyExtractorSimpleBody |
net472 | 295ns | 0.385ns | 1.39ns | 0.0574 | 0 | 0 | 361 B |
| #3341 | BodyExtractorSimpleBody |
netcoreapp3.1 | 230ns | 0.0788ns | 0.295ns | 0.0037 | 0 | 0 | 272 B |
| #3341 | BodyExtractorMoreComplexBody |
net472 | 15.5μs | 12.2ns | 45.8ns | 1.2 | 0.0155 | 0 | 7.62 KB |
| #3341 | BodyExtractorMoreComplexBody |
netcoreapp3.1 | 13.1μs | 10.2ns | 35.2ns | 0.0911 | 0 | 0 | 6.75 KB |
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
| master | SendRequest |
netcoreapp3.1 | 180μs | 157ns | 608ns | 0.27 | 0 | 0 | 20.68 KB |
| #3341 | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
| #3341 | SendRequest |
netcoreapp3.1 | 181μs | 250ns | 937ns | 0.181 | 0 | 0 | 20.68 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteNonQuery |
net472 | 1.85μs | 0.917ns | 3.18ns | 0.155 | 0.000923 | 0 | 979 B |
| master | ExecuteNonQuery |
netcoreapp3.1 | 1.45μs | 0.697ns | 2.7ns | 0.0131 | 0 | 0 | 968 B |
| #3341 | ExecuteNonQuery |
net472 | 1.9μs | 0.563ns | 2.11ns | 0.155 | 0.00095 | 0 | 979 B |
| #3341 | ExecuteNonQuery |
netcoreapp3.1 | 1.45μs | 2.76ns | 10.7ns | 0.0129 | 0 | 0 | 968 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | CallElasticsearch |
net472 | 2.61μs | 0.936ns | 3.5ns | 0.188 | 0 | 0 | 1.19 KB |
| master | CallElasticsearch |
netcoreapp3.1 | 1.54μs | 0.646ns | 2.42ns | 0.0154 | 0 | 0 | 1.13 KB |
| master | CallElasticsearchAsync |
net472 | 2.62μs | 1.52ns | 5.87ns | 0.21 | 0 | 0 | 1.32 KB |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 1.61μs | 0.474ns | 1.84ns | 0.0169 | 0 | 0 | 1.25 KB |
| #3341 | CallElasticsearch |
net472 | 2.55μs | 0.947ns | 3.67ns | 0.188 | 0 | 0 | 1.19 KB |
| #3341 | CallElasticsearch |
netcoreapp3.1 | 1.52μs | 0.359ns | 1.39ns | 0.0154 | 0 | 0 | 1.13 KB |
| #3341 | CallElasticsearchAsync |
net472 | 2.71μs | 0.897ns | 3.36ns | 0.209 | 0 | 0 | 1.32 KB |
| #3341 | CallElasticsearchAsync |
netcoreapp3.1 | 1.56μs | 0.862ns | 3.34ns | 0.0163 | 0 | 0 | 1.25 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net472 | 2.79μs | 1.35ns | 5.23ns | 0.23 | 0 | 0 | 1.45 KB |
| master | ExecuteAsync |
netcoreapp3.1 | 1.77μs | 0.593ns | 2.22ns | 0.0186 | 0 | 0 | 1.38 KB |
| #3341 | ExecuteAsync |
net472 | 2.69μs | 1.36ns | 5.26ns | 0.23 | 0 | 0 | 1.45 KB |
| #3341 | ExecuteAsync |
netcoreapp3.1 | 1.73μs | 0.403ns | 1.56ns | 0.0182 | 0 | 0 | 1.38 KB |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendAsync |
net472 | 5.87μs | 1.86ns | 6.98ns | 0.443 | 0 | 0 | 2.8 KB |
| master | SendAsync |
netcoreapp3.1 | 3.62μs | 2.54ns | 9.51ns | 0.0345 | 0 | 0 | 2.63 KB |
| #3341 | SendAsync |
net472 | 5.87μs | 1.99ns | 7.43ns | 0.445 | 0 | 0 | 2.8 KB |
| #3341 | SendAsync |
netcoreapp3.1 | 3.68μs | 0.939ns | 3.39ns | 0.0367 | 0 | 0 | 2.63 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 3.1μs | 4ns | 15.5ns | 0.298 | 0 | 0 | 1.88 KB |
| master | EnrichedLog |
netcoreapp3.1 | 2.47μs | 1.13ns | 4.39ns | 0.0259 | 0 | 0 | 1.91 KB |
| #3341 | EnrichedLog |
net472 | 3.21μs | 1.64ns | 6.14ns | 0.298 | 0 | 0 | 1.88 KB |
| #3341 | EnrichedLog |
netcoreapp3.1 | 2.47μs | 0.914ns | 3.42ns | 0.0259 | 0 | 0 | 1.91 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 152μs | 141ns | 547ns | 0.678 | 0.226 | 0 | 4.72 KB |
| master | EnrichedLog |
netcoreapp3.1 | 120μs | 253ns | 979ns | 0.0603 | 0 | 0 | 4.55 KB |
| #3341 | EnrichedLog |
net472 | 152μs | 99.3ns | 385ns | 0.687 | 0.229 | 0 | 4.72 KB |
| #3341 | EnrichedLog |
netcoreapp3.1 | 122μs | 145ns | 561ns | 0.0612 | 0 | 0 | 4.55 KB |
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 5.86μs | 2.77ns | 10.7ns | 0.578 | 0.00292 | 0 | 3.65 KB |
| master | EnrichedLog |
netcoreapp3.1 | 4.46μs | 8.48ns | 32.8ns | 0.0555 | 0 | 0 | 3.98 KB |
| #3341 | EnrichedLog |
net472 | 5.8μs | 1.67ns | 6.04ns | 0.578 | 0.00291 | 0 | 3.65 KB |
| #3341 | EnrichedLog |
netcoreapp3.1 | 4.6μs | 2.37ns | 8.86ns | 0.0549 | 0 | 0 | 3.98 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendReceive |
net472 | 2.37μs | 2.36ns | 8.52ns | 0.223 | 0 | 0 | 1.4 KB |
| master | SendReceive |
netcoreapp3.1 | 1.8μs | 0.709ns | 2.75ns | 0.018 | 0 | 0 | 1.35 KB |
| #3341 | SendReceive |
net472 | 2.3μs | 1.15ns | 4.14ns | 0.222 | 0 | 0 | 1.4 KB |
| #3341 | SendReceive |
netcoreapp3.1 | 1.87μs | 0.781ns | 2.92ns | 0.0187 | 0 | 0 | 1.35 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 5.03μs | 4.05ns | 15.7ns | 0.364 | 0 | 0 | 2.3 KB |
| master | EnrichedLog |
netcoreapp3.1 | 4.41μs | 1.73ns | 6.23ns | 0.0242 | 0 | 0 | 1.86 KB |
| #3341 | EnrichedLog |
net472 | 5.14μs | 2.32ns | 8.67ns | 0.363 | 0 | 0 | 2.3 KB |
| #3341 | EnrichedLog |
netcoreapp3.1 | 4.28μs | 0.965ns | 3.34ns | 0.0236 | 0 | 0 | 1.86 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartFinishSpan |
net472 | 1.17μs | 0.369ns | 1.38ns | 0.134 | 0 | 0 | 842 B |
| master | StartFinishSpan |
netcoreapp3.1 | 944ns | 0.311ns | 1.12ns | 0.0108 | 0 | 0 | 792 B |
| master | StartFinishScope |
net472 | 1.45μs | 0.481ns | 1.8ns | 0.146 | 0 | 0 | 923 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.05μs | 0.225ns | 0.811ns | 0.0121 | 0 | 0 | 912 B |
| #3341 | StartFinishSpan |
net472 | 1.19μs | 0.343ns | 1.24ns | 0.134 | 0 | 0 | 842 B |
| #3341 | StartFinishSpan |
netcoreapp3.1 | 916ns | 0.243ns | 0.943ns | 0.0106 | 0 | 0 | 792 B |
| #3341 | StartFinishScope |
net472 | 1.37μs | 0.185ns | 0.667ns | 0.146 | 0 | 0 | 923 B |
| #3341 | StartFinishScope |
netcoreapp3.1 | 1.11μs | 0.462ns | 1.66ns | 0.0122 | 0 | 0 | 912 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunOnMethodBegin |
net472 | 1.51μs | 0.391ns | 1.51ns | 0.147 | 0 | 0 | 923 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.14μs | 0.92ns | 3.44ns | 0.0124 | 0 | 0 | 912 B |
| #3341 | RunOnMethodBegin |
net472 | 1.47μs | 0.729ns | 2.73ns | 0.146 | 0 | 0 | 923 B |
| #3341 | RunOnMethodBegin |
netcoreapp3.1 | 1.18μs | 1.52ns | 5.87ns | 0.0122 | 0 | 0 | 912 B |
Member
Code Coverage Report 📊✔️ Merging #3341 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
The following classes were added in #3341:
View the full reports for further details: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
This PR adds support for Intelligent Test Runner in the MSTest testing framework integration.
Reason for change
It was the only CI Visibility supported testing framework that was lacking of Intelligent Test Runner support.
Implementation details
We create a new integration to replace the
Executorinstance of the tests we want to skip. The customExecutorwill skip theMethodInfo.Invokecall and return that the test was skipped.