-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: minio testhelper add content method #524
Conversation
@@ -116,3 +126,46 @@ func Setup(pool *dockertest.Pool, d resource.Cleaner, opts ...func(*Config)) (*R | |||
Client: client, | |||
}, nil | |||
} | |||
|
|||
func (r *Resource) Contents(ctx context.Context, prefix string) ([]File, error) { |
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.
[nitpick] This receiver has a different name than the other one. We could name both r
.
Recursive: true, | ||
Prefix: prefix, | ||
} | ||
for objInfo := range r.Client.ListObjects(ctx, r.BucketName, opts) { |
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.
What happens if the context gets cancelled? Don't we have to check objInfo.Err
? 🤔
var r io.Reader | ||
br := bufio.NewReader(o) | ||
magic, err := br.Peek(2) | ||
if err == nil && magic[0] == 31 && magic[1] == 139 { |
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.
Can we have a comment here please?
Description
Add content method to testhelper minio resource, to avoid code repetition in tests.
Linear Ticket
https://linear.app/rudderstack/issue/PIPE-1179/rudder-go-kit-testhelper-miniocontents
resolves PIPE-1179
Security