Skip to content
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 unit tests for match function in analytics controller #97

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

alierkilic
Copy link
Contributor

This will address issue: Unit tests for crane #91

If you have any problems with the test names please let me know

@qmhu
Copy link
Member

qmhu commented Jan 12, 2022

@alierkilic thanks for you contribution, you can combine your unit test into one like :https://github.com/gocrane/crane/blob/main/pkg/controller/ehpa/hpa_test.go#L6

@alierkilic
Copy link
Contributor Author

Should I mock the function calls inside Reconcile, SetupWithManager and createRecommendation? I don't see gomock used in the project.

@mfanjie
Copy link
Contributor

mfanjie commented Jan 13, 2022

@alierkilic mock testing are wanted! you don't see those tests because we are still focusing on core feature development. It's perfect if you can start from such tasks.

@mfanjie
Copy link
Contributor

mfanjie commented Jan 13, 2022

can you squash commits of this PR?

@alierkilic
Copy link
Contributor Author

@mfanjie I will start working on it

@mfanjie
Copy link
Contributor

mfanjie commented Jan 14, 2022

@alierkilic you can still refine this pr and merge the commit, more UT can be done in separated PR.

@alierkilic alierkilic reopened this Jan 14, 2022
@alierkilic
Copy link
Contributor Author

@mfanjie can you accept this PR? If the merge commit is a problem, I can force push an older head, merge and then add my changes. It was like that before. I think I accidentally closed it.

@mfanjie
Copy link
Contributor

mfanjie commented Jan 15, 2022

plz squash commits

Copy link
Contributor

@mfanjie mfanjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest to simplify the description

pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
pkg/controller/analytics/analytics_controller_test.go Outdated Show resolved Hide resolved
Signed-off-by: alierkilic <erkilic.alican@gmail.com>

Refactor unit test for match function

Signed-off-by: alierkilic <erkilic.alican@gmail.com>

Add unit test for match function in analytics controller
@alierkilic
Copy link
Contributor Author

alierkilic commented Jan 20, 2022

suggest to simplify the description

@mfanjie done

@mfanjie
Copy link
Contributor

mfanjie commented Jan 25, 2022

/lgtm

@mfanjie mfanjie merged commit 38d63e6 into gocrane:main Jan 25, 2022
@qmhu qmhu linked an issue Feb 15, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit tests for crane
3 participants