interop: add builder and path options in compositions' groups#1367
interop: add builder and path options in compositions' groups#1367laurentsenta merged 11 commits intomasterfrom
Conversation
1e99db6 to
419193a
Compare
0719a02 to
2c2e7ec
Compare
| COPY . . | ||
|
|
||
| ARG PLAN_PATH | ||
| RUN cd plan/${PLAN_PATH} && go build -a -o /testplan |
There was a problem hiding this comment.
This is how you use PLAN_PATH in docker:generic builder.
|
@mxinden asking for your review, if you have time to take a look at the API (the manifest in the PR description) and how we use it in the |
mxinden
left a comment
There was a problem hiding this comment.
🚀 Interface looks good to me. That should be all we need to build both Go and Rust.
| @@ -0,0 +1,21 @@ | |||
| name = "integrations" | |||
There was a problem hiding this comment.
Is this manifest.toml still needed even though we have the composition file?
There was a problem hiding this comment.
Yea, right now they are required, we might eventually drop them later.
| @@ -0,0 +1,14 @@ | |||
| ARG image | |||
| FROM ${image} AS builder | |||
There was a problem hiding this comment.
I am guessing that this is how I would be passing feature flags from the composition file to the cargo build command? Works for me. Great.
There was a problem hiding this comment.
Yes! And we'd use the PLAN_PATH below to dispatch between go and rust code.
|
|
||
| // Trickle builder configuration | ||
| for _, grp := range c.Groups { | ||
| if grp.Builder == "" { |
There was a problem hiding this comment.
The only thing I would improve here is avoid code duplication (lines 30-31, when validating the composition file). The check for group and global builder is the same (builder != "")
Maybe extract it to a separate validation function, e.g. validateGroupBuilder(gs Groups) ?
There was a problem hiding this comment.
Thanks for the thorough review, you're right,
I dropped the validation in prepareForBuild since that's a different operation.
1454919 to
a751b25
Compare
builderoption in groups, that lets a user override the builder used by a test,build_config.pathoption fordocker:goanddocker:genericthat lets a user define a subfolder for their test.We provide
ARG PLAN_PATHto thedocker:genericcontainer as a helper (a user might also set the value themselves through build config options).With these two features, we can define a test that builds go and rust code, or go and node, or node, and rust, etc.
Fixes #1357 and #1305
Example of composition.yml
Tasks
pathoption indocker:genericanddocker:goto is a subfolder as the test source rootpkgfolder until we tackle EPIC: Speed up development with improved integration testing tooling (no more shell scripts or flakiness) #1368