Conversation
c6cde62 to
43558bb
Compare
jbw976
left a comment
There was a problem hiding this comment.
this will be nice to have an e2e test pattern in place for folks starting from the template repo, thanks for doing this!
i haven't kept super up to date with these patterns myself though, does the implementation in this PR come from a particular example/docs/etc.? It'd be good to align on that first and then dive into the specifics on this implementation. thank you!
Hey, until now, I still have not much idea around how So I need to have a Do you have any specific pattern you would like to see when running |
|
cool @cychiang!! following an uptest pattern is totally reasonable, I just personally haven't had much experience with it. Do you still have more to research into here or are you feeling comfortable with the current implementation? Can you comment about how you've verified that this is working OK? |
Signed-off-by: Chuan-Yen Chiang <cychiang0823@gmail.com>
43558bb to
b2dcc22
Compare
Signed-off-by: Chuan-Yen Chiang <cychiang0823@gmail.com>
Signed-off-by: Chuan-Yen Chiang <cychiang0823@gmail.com>
Signed-off-by: Chuan-Yen Chiang <cychiang0823@gmail.com>
adding e2e tests. Signed-off-by: Chuan-Yen Chiang <cychiang0823@gmail.com>
- Update docs Signed-off-by: Chuan-Yen Chiang <cychiang0823@gmail.com>
@jbw976 I have updated test cases, and adopt to chainsaw as
|
jbw976
left a comment
There was a problem hiding this comment.
awesome, thanks for continuing to drive this and establish a pattern here! everything seemed to run OK on my machine in my manual test run, so most of my questions are to make sure we are following and/or setting the right patterns in place for folks that use this template as a starter for their providers in the future. Thank you!
| @@ -0,0 +1,33 @@ | |||
| apiVersion: sample.template.crossplane.io/v1alpha1 | |||
There was a problem hiding this comment.
Just looking quickly at other providers in crossplane/crossplane-contrib, it looks like they have a pattern of pointing uptest at their examples/ via UPTEST_EXAMPLE_LIST rather than a separate test manifest, with the annotations right in the examples (e.g. provider-kubernetes).
Do you think we should do the same to be consistent and to make sure the examples we publish are what are getting tested as opposed to maintaining separate e2e manifests?
I'm not married to that idea, because I can see the value of having a dedicated e2e test section/manifests also, so it's just an idea to explore here. You can make the call!
| 5. Run `make reviewable` to run code generation, linters, and tests. | ||
| 5. Run `make build` to build the provider. | ||
|
|
||
| ## Testing |
There was a problem hiding this comment.
make provider.prepare deletes apis/sample and internal/controller/mytype but only rewrites template, so MyType survives all through the new test/ files.
Not a blocker since the repo doesn't compile after prepare anyway, but test/ is now a fourth place to fix up and it's missing from the Developing steps. should we add a line for it there?
| @@ -0,0 +1,25 @@ | |||
| #!/usr/bin/env bash | |||
| set -euo pipefail | |||
There was a problem hiding this comment.
I don't think this file can fail a run, so its exit 1s may not do anything.
i had an agent look into it more and the conclusion was that uptest drops pre-delete hooks into a chainsaw script block followed by the delete commands, and there's no set -e, so only the last command's exit code counts. Post-assert hooks are fine, those get rendered as a command entrypoint. the agent checked both on a kind cluster too.
do you want to confirm this suspicion too?
As is in this template repo, it doesn't matter too much because the import step already asserts what this hook checks, but folks building their own provider from this template and following this pattern could end up adding a real assertion in there and never know it didn't run. Should we keep this hook still you think? 🤔
|
|
||
| UPTEST_LOCAL_DEPLOY_TARGET = local.xpkg.deploy.provider.$(PROJECT_NAME) | ||
| UPTEST_INPUT_MANIFESTS = test/e2e/00-lifecycle.yaml | ||
| -include build/makelib/uptest.mk |
There was a problem hiding this comment.
I noticed the local-dev cluster was still hanging around after running make e2e so I checked in on that a bit.
controlplane.down is a prerequisite of e2e in uptest.mk, so the teardown runs before the setup rather than after it:
16:53:01 [ .. ] deleting controlplane
Deleting cluster "local-dev" ...
16:53:27 [ .. ] setting up controlplane
Creating cluster "local-dev" ...
So it looks like it cleans up any local-dev that exists at the start then leaves the one it created running when the run finishes.
Is that what we want? 🤔
Description of your changes
Add missing e2e tests for the provider-template. It includes:
buildto latest mainI have:
make reviewableto ensure this PR is ready for review.backport release-x.ylabels to auto-backport this PR if necessary.How has this code been tested
make e2e