-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 prerun TestMain
function to test utils
#5205
Conversation
Signed-off-by: Josef Karasek <[email protected]>
Thank you for your contribution! 🙏 We will review your PR as soon as possible. While you are waiting, make sure to:
Learn more about: |
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.
lgtm
} | ||
return KubeClient, nil | ||
} | ||
|
||
func GetKedaKubernetesClient(t *testing.T) *v1alpha1.KedaV1alpha1Client { |
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.
I will take a look later if I can manage to remove this call from all tests so the test setup logic is in a single place
. "github.com/kedacore/keda/v2/tests/helper" | ||
) | ||
|
||
func TestMain(m *testing.M) { |
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.
might be interesting to see if we can move this to either helper
package or some common test package later
Hello, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Do we have any update on this? |
The use case for this is too narrow, so closing the PR. |
In my individual testing I was using TestVerifyKEDA to wait for keda cluster to come up, but it didn't work because the test didn't have kubernetes client.
Since TestMain is a standard way in go testing to setup test env before the test suite is executed, I think that this change can be beneficial for other keda users.
Checklist
Relates to #