-
-
Notifications
You must be signed in to change notification settings - Fork 978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding tests for export of csv and csv Measurements #2387
base: master
Are you sure you want to change the base?
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but will wait for Andrey to take a look before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.