-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Add an integration/internal/container helper package #36266
Conversation
ae95f86
to
8278c63
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
} | ||
|
||
func Create(t *testing.T, ctx context.Context, client client.APIClient, ops ...func(*TestContainerConfig)) string { | ||
config := &TestContainerConfig{ |
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.
Should we t.Helper()
in these so the error gets reported from the caller?
) | ||
|
||
type TestContainerConfig struct { | ||
Name string |
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.
I wish we had this struct (and ops) for the actual client
package! I guess we can look at doing that later
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.
That's definitely sthg we should do 👼 (It's now on my todo 😛)
8278c63
to
c4054ff
Compare
c4054ff
to
0958efb
Compare
To help creating/running/… containers using the client for test integration. This should make test more readable and reduce duplication a bit. Usage example ``` // Create a default container named foo id1 := container.Create(t, ctx, client, container.WithName("foo")) // Run a default container with a custom command id2 := container.Run(t, ctx, client, container.WithCmd("echo", "hello world")) ``` Signed-off-by: Vincent Demeester <vincent@sbr.pm>
0958efb
to
0bb7d42
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, Thanks!
On top of #36265
To help creating/running/… containers using the client for test integration.
This should make test more readable and reduce duplication a bit.
Usage example
This replace
runSimpleContainer
andcreateSimpleContainer
👼Signed-off-by: Vincent Demeester vincent@sbr.pm