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

testutil: Moving all e2e utils to separate package, added TB union. #2077

Merged
merged 1 commit into from
Jan 30, 2020

Conversation

bwplotka
Copy link
Member

Signed-off-by: Bartlomiej Plotka bwplotka@gmail.com

Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

lgtm. I have a couple of ignorable comments.

@@ -11,6 +11,7 @@ import (
"path/filepath"

"github.com/thanos-io/thanos/pkg/block/metadata"
"github.com/thanos-io/thanos/pkg/testutil/e2eutil"
Copy link
Member

Choose a reason for hiding this comment

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

nit: Shall we group the imports? Does it even matter for the tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

we should but we don't have tools for that so it's tedious and I am lazy (:

@jojohappy if you were asking if still valid: #984

}

func (tb *UnionTB) IsBenchmark() bool {
if _, ok := tb.TB.(*testing.B); ok {
Copy link
Member

@kakkoyun kakkoyun Jan 29, 2020

Choose a reason for hiding this comment

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

I'm totally NOT sure if this makes it easier to read or not, but the following could also be used

Suggested change
if _, ok := tb.TB.(*testing.B); ok {
_, ok := tb.TB.(*testing.B)
return ok

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense 👍

func (tb *UnionTB) ResetTimer() {
if b, ok := tb.TB.(*testing.B); ok {
b.ResetTimer()
return
Copy link
Member

Choose a reason for hiding this comment

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

very minor nit: not needed return :P

Copy link
Member

@jojohappy jojohappy left a comment

Choose a reason for hiding this comment

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

LGTM! Only some small nits from @kakkoyun and @GiedriusS .

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
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