-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: add missing skip in s3 driver test #4219
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
Conversation
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
@@ -203,6 +203,8 @@ func TestEmptyRootList(t *testing.T) { | |||
} | |||
|
|||
func TestClientTransport(t *testing.T) { | |||
skipCheck(t) |
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.
This isn't needed here. This is a unit test, we only skip integration tests
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.
fails downstream with
> --- FAIL: TestClientTransport (0.00s)
> --- FAIL: TestClientTransport/SkipVerify_true (0.00s)
> s3_test.go:225: failed to create driver: no region parameter provided
> --- FAIL: TestClientTransport/SkipVerify_false (0.00s)
> s3_test.go:225: failed to create driver: no region parameter provided
Would be nice if we could run unit tests without setting any required environment variables.
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.
We probably might want to change the test params to avoid reading env vars in unit tests instead of skipping the test completely if they're not set.
params := map[string]interface{}{
"region": os.Getenv("AWS_REGION"),
"bucket": os.Getenv("S3_BUCKET"),
"skipverify": tc.skipverify,
}
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.
Updated the test to use constant strings instead, removed test skipping.
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.
Actually, you know what. I'm being completely silly here. We should aim to be consistent -- I noticed there are some other unit tests like TestStorageClass
that skip tests...can we revert this to your original change? I'm so sorry, xmas holidays fatigue took over my thinking 😵💫
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.
Sure, no problem. :)
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.
We probably might want to change the test params to avoid reading env vars in unit tests instead of skipping the test completely if they're not set.
Also wondering indeed if (as a follow-up) these unit-tests should ultimately get a t.SetEnv
(if these env-vars are needed (but not actually make connections)) or otherwise some setupTest(t)
if something actually needs to be set up (from a quick test, it looks like these may not be very 'unit" tests"
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.
using t.Setenv
is complicated because we construct the driver in the init
func 🤔 something to think about for sure
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.
Yeah, not a huge fan of init()
but also haven't looked closely
6908e0d
to
514477c
Compare
514477c
to
6908e0d
Compare
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 I feel there's something to look into if these tests need setting up (see my comment above)
No description provided.