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

Feature/controllers tests #126

Merged
merged 7 commits into from
Oct 24, 2022

Conversation

volodymyrZotov
Copy link
Collaborator

No description provided.

Copy link
Member

@edif2008 edif2008 left a comment

Choose a reason for hiding this comment

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

Code review: ✅
These tests look really solid. Thank you for migrating these test cases. Much appreciated.

I have a couple of notes:

  • For the deployment controller tests, the Before section has By parts that show up even before providing the Context or the It part. This ends up with an odd ordering of the actions, which makes debugging a bit nasty.
  • Some descriptions seem to focus on the end result rather than what actually happens in that test case. We can discuss more about these in a call.

controllers/onepassworditem_controller_test.go Outdated Show resolved Hide resolved
controllers/onepassworditem_controller_test.go Outdated Show resolved Hide resolved
controllers/onepassworditem_controller_test.go Outdated Show resolved Hide resolved
controllers/onepassworditem_controller_test.go Outdated Show resolved Hide resolved
controllers/onepassworditem_controller_test.go Outdated Show resolved Hide resolved
controllers/onepassworditem_controller_test.go Outdated Show resolved Hide resolved
controllers/onepassworditem_controller_test.go Outdated Show resolved Hide resolved
controllers/deployment_controller_test.go Outdated Show resolved Hide resolved
controllers/deployment_controller_test.go Outdated Show resolved Hide resolved
controllers/deployment_controller_test.go Outdated Show resolved Hide resolved
@volodymyrZotov
Copy link
Collaborator Author

@edif2008 Context, Describe, When is the same suite wrappers (they call them node containers in ginkgo world). And they exist for the same purpose - to organize the different aspects of code that we are testing hierarchically.

There is no restriction on how you should use them (for example it's ok to use Context inside Describe, or By inside Context, or Describe inside Context.)

The one general rule here is that It (subject node) should be inside Context/Describe (node containers).
That article might help to understand what ginkgo does under the hood.

@volodymyrZotov volodymyrZotov merged commit a132741 into feature/migrate-operator Oct 24, 2022
@volodymyrZotov volodymyrZotov deleted the feature/controllers_tests branch October 24, 2022 12:15
@github-actions github-actions bot mentioned this pull request Nov 11, 2022
2 tasks
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.

2 participants