-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: end to end testing with local provider implementation #5933
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Raffaele Di Fazio <[email protected]>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Pull Request Test Coverage Report for Build 19195986294Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
For the feature, it would really help and improve quality to have CI like this 👍 . For the implementation choice, I'm still unsure 🤔. ✔️ On one hand, having a small custom DNS implementation allows behavior flexibility and speed 💡 It remembers me that I've opened a PR about documenting usage of coredns for local dev testing (#5887). @Raffo Did you consider using coredns as an option for the implementation ? |
Co-authored-by: Michel Loiseleur <[email protected]>
Co-authored-by: Michel Loiseleur <[email protected]>
|
@mloiseleur Yes, I considered it. Unfortunately coreDNS doesn't really work. It re needs a whole etcd server up and running. And that sounded more complicated than what we wanted to do. Remind that we're not testing a provider, any provider, not the coredns provider, not this fake provider, but we're testing the core of the project like the image can start and the plan works and and so on. Happy to change, but currently a bit unsure of the benefits as well 🤔 |
What does it do ?
This pull request implements end to end testing by using a new custom local provider that saves records in memory. The idea behind this is that the new local provider, configured as a webhook, will create records in memory based on the usual Kubernetes resources. The same code exposes a minimal implementation of a DNS server. We can then query directly this minimal DNS server to verify that external DNS did its job. This idea allows us to implement end-to-end testing without having to issue certificates or creating real domains. The script can be launched with a bash script, and are wrapped in GitHub actions to be executed on GitHub.
Motivation
We have custom end-to-end testing infrastructure since almost the beginning of this project that I've been maintaining myself. That infrastructure has relied on an AWS account, and a private zone. Unfortunately, due to security requirements, I cannot make that infrastructure available to the bigger project, and that meant that I was always the bottleneck to run end to end tests. The motivation behind this work is to stop using that infrastructure and relying only on kind and local tests.
#5601
More
I went through a lot of ideas also using the /etc/hosts file which is not possible for a number of reasons in Kubernetes and other possible alternatives. This is what I landed to and the code is probably not perfect. I would love anyway for feedback and I will keep this and as draft until I will have received this feedback.