-
Notifications
You must be signed in to change notification settings - Fork 3
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 E2E Tests #23
base: main
Are you sure you want to change the base?
Add E2E Tests #23
Conversation
ccbcf6c
to
1a1dfe2
Compare
1a1dfe2
to
d41517f
Compare
@zliang-akamai just wondering if you've consider using Chainsaw as an e2e framework? I've used it on Provider Ceph and I believe it has been implemented in COSI Driver and CAPL recently too. Might be worth checking out if you haven't already. 😃 |
@nolancon thanks for the suggestion! I can take a look for sure. |
@@ -5,3 +5,8 @@ bin/ | |||
.DS_Store | |||
|
|||
vendor/ | |||
|
|||
e2e/opentofu/.terraform/** |
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.
Just FYI, in other projects we use Linode Cluster API because Terraform provider is deprecated as i know.
@nolancon @mhmxs, so decorator requires the Linode metadata API to work,
|
Here is an example of CAPL management cluster: https://github.com/linode/linode-blockstorage-csi-driver/pull/163/files#diff-0908e8aad04dc51bce3a028b466879848a0cf5e57f2ee1af8bf08a599c600e23 and the one to create the E2E cluster on Linode: https://github.com/linode/linode-blockstorage-csi-driver/pull/163/files#diff-1bf5be570b019689c0945a7ad6bbbe07e8a05769685c47c07ec3a67a71d74d55 Mocking is only an option for unit tests. I did a short research, and i don't see any other option to properly test this project than how you did. But I strongly suggest to swap to CAPL and Chainsaw, because both would be used more widely in the future. Here is the simplest adoption of chainsaw: https://github.com/linode/linode-cosi-driver/pull/55/files If you have any question please feel free to reach me out. |
For tooling management we use a mixed Makefile+Devbox combo, so it would be nice, if you can follow this style. (linked projects contain the examples) |
@mhmxs Thank you! I will follow the style you mentioned. Mocking API is option one, and I recently learned about local (in-cluster) registry option, and I am going to do some research. Do you think a local image registry in the cluster can be the registry that the cluster pulls from? |
@ChihweiLHBird The local registry has local url. So you have to
|
I am still working on the corresponding GHA workflow, but this can works locally when you have a
kubeconfig
file from a LKE.Update:
GitHub workflow for this is actually quite complicated because we have to handle test image cleanup after the test, and there is not a official GitHub action or a simple docker command that can achieve this. We might have to invoke Docker Hub API directly for removing it. Would like to hear more thought on this.
hub-tool maybe an option to cleanup the images, but currently missing CI friendly login feature.
How to run
export KUBECONFIG=/path/to/your/lke/kubeconfig
export TEST_IMAGE_REPO=your-repo
export TEST_IMAGE_TAG=your-tag
go test ./e2e -count=1 -v