Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding tests for export of csv and csv Measurements #2387

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

Open
Nepp3r wants to merge 4 commits into dotnet:master
base: master
Choose a base branch
Loading
from Nepp3r:csvExportTests

Conversation

Copy link

@Nepp3r Nepp3r commented Aug 1, 2023

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.

Copy link
Author

Nepp3r commented Aug 1, 2023

@dotnet-policy-service agree

Copy link
Author

Nepp3r commented Aug 2, 2023
edited
Loading

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

Copy link
Collaborator

was todo to add CsvExporter and CsvMeasurementsExporter

Can you remove that todo since you did it?

Copy link
Collaborator

@timcassell timcassell left a 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.

Nepp3r reacted with thumbs up emoji
Copy link
Member

@AndreyAkinshin AndreyAkinshin left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AndreyAkinshin AndreyAkinshin AndreyAkinshin requested changes

@timcassell timcassell timcassell approved these changes

+1 more reviewer

@kant2002 kant2002 kant2002 left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /