-
Notifications
You must be signed in to change notification settings - Fork 62
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
Git server controller test does not include built-in controllers #37
Comments
So, if I understand correctly the problem, it is then needed that:
Were the test cases working before ? |
Not sure if it was working before. @greghaynes ? To me looks like it was written before writing the code being tested, which is good. It's just that the We could use kind cluster to test them all but not sure if it's necessary. The advantage of As for running the test, looks like you need to run ~/idpbuilder$ tree bin/
bin/
├── controller-gen
├── k8s
│ └── 1.27.1-linux-amd64
│ ├── etcd
│ ├── kube-apiserver
│ └── kubectl
└── setup-envtest
|
Correct. We just need to run as testing environment kubebuilder where the idp controllers are registered for the tests. |
env test is set up here
idpbuilder/pkg/controllers/gitserver/controller_test.go
Line 31 in fd507f5
UseExistingCluster
is set to false (zero value)https://github.com/kubernetes-sigs/controller-runtime/blob/7db81c7b27468b517d70ce3f7da49b134ec51fec/pkg/envtest/server.go#L152
Per this doc, no built-in controllers run https://book.kubebuilder.io/reference/envtest.html#testing-considerations
So no deployment is created and the test fails.
Not sure if there is a easy way around this.
The text was updated successfully, but these errors were encountered: