Skip to content
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

tests: extract sniffArgs helper #139728

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

tests: extract sniffArgs helper #139728

wants to merge 1 commit into from

Conversation

tbg
Copy link
Member

@tbg tbg commented Jan 24, 2025

Extracted from #139557 (where this will be used a little more).

This now has a unit test, too. The old version had numerous bugs.

This now has a unit test, too. The old version had numerous bugs.
@tbg tbg requested a review from RaduBerinde January 24, 2025 11:39
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @tbg)


pkg/sql/tests/sniff_args_test.go line 25 at r1 (raw file):

// This is a helper for benchmarks that want to react to flags from their
// environment.
func sniffArgs(inArgs []string, names []string, out []*string) error {

[nit] Is there any advantage to passing all args at once, vs multiple calls like memProfile := sniffArg(inArgs, "test.memprofile") which look much cleaner?

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @tbg)


pkg/sql/tests/sniff_args_test.go line 25 at r1 (raw file):

// This is a helper for benchmarks that want to react to flags from their
// environment.
func sniffArgs(inArgs []string, names []string, out []*string) error {

[nit] This could live in a sniff_args.go, we have other things like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants