Adding tests for export of csv and csv Measurements#2387
Adding tests for export of csv and csv Measurements#2387Nepp3r wants to merge 4 commits intodotnet:masterfrom
Conversation
|
@dotnet-policy-service agree |
|
I have a Fedora on VM box, so clear linux, and I ran same tests with my branch, but they ended without any errors, what would cause a problem on your Linux but not on my? All verified files have CRLF end of line symbols, including files I didn't change |
Can you remove that todo since you did it? |
timcassell
left a comment
There was a problem hiding this comment.
LGTM, but will wait for Andrey to take a look before merging.
AndreyAkinshin
left a comment
There was a problem hiding this comment.
I don't like this approach, specifically hacking the global instance of EnvironmentResolver.
The original idea behind IResolver was to provide an opportunity to easily customize the resolve logic for all the basic characteristics like affinity. Unfortunately, the resolver/characteristics system turned out to be overcomplicated, so it's not so easy to use it. Therefore, BenchmarkDotNet uses static instances of various resolvers here and there (like in BenchmarkDotNet.Columns.JobCharacteristicColumn.GetValue). A proper approach here is to somehow pass a resolver to all the places where it is needed so that it can be easily overridden in the tests.
It's always good to increase our test coverage, but I'd rather avoid introducing additional internal test-only methods for changing statistic instances. It makes our code base more fragile and increases the technical dept. A better solution is to invest efforts in refactoring the existing design so that we can write tests without using internal methods.
Hello,
I've noticed, that in BenchmarkDotNet.Tests.Exporters.VerifiedFiles.CommonExporterVerifyTests was todo to add CsvExporter and CsvMeasurementsExporter, so I added them and mocked verified.txt files.