Expose testutil integration workers as public#3866
Merged
Conversation
crazy-max
approved these changes
May 12, 2023
Signed-off-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Justin Chadwell <me@jedevc.com>
6b7f5d7 to
0cc3c30
Compare
tonistiigi
approved these changes
May 12, 2023
tonistiigi
reviewed
May 12, 2023
| @@ -35,6 +35,7 @@ func init() { | |||
| // Backend is the minimal interface that describes a testing backend. | |||
| type Backend interface { | |||
Member
There was a problem hiding this comment.
This could maybe use some future refactoring if we want to make integration pkg more reusable. Currently, some of these methods are very specific for a single worker implementation (or "buildkit worker" implementation). Ideally this could be used for any backend. Now that worker implementations are public they don't need to be always defined and imported with this pkg either.
Otoh, we need to be careful that the test sides do not need a lot of boilerplate for type checking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR exposes the integration test workers as public, performing a few small refactors to make them more flexible (so that the caller can always enforce a custom name).
This is designed to be used in the context of docker/buildx#1770, where we wrap the
mobyworker to create thedockerdriver worker, and wrap theociworker to create theremotedriver worker.This allows us to avoid copying all the logic to spin up buildkit sandboxes inside of buildx, and to share that logic, so that we can automatically consume changes from the upstream test framework.
Additionally, we also add a new
DockerAddressmethod to theBackendinterface which returns the address of the UNIX socket for worker backends that support it (currently only moby).type Backend interface { Address() string + DockerAddress() string ContainerdAddress() string ...This is designed to be consumed by the buildx
dockerdriver worker wrapper, so that we can connect directly to the docker instance using thedockerdriver.