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

Rewrite all the tests to testenv with gomega #356

Merged
merged 5 commits into from
Apr 26, 2022
Merged

Rewrite all the tests to testenv with gomega #356

merged 5 commits into from
Apr 26, 2022

Conversation

darkowlzz
Copy link
Contributor

Rewrite all the envtest ginkgo based tests using testenv with gomega.

Based on #221, with all the latest changes and tests.

NOTE: Majority of the changes here are based on the work in #211. I believe a lot of it would change with the gradual rewrite for adopting the new controller standards. The tests are still very verbose. I think we can improve that after getting over with ginkgo first.

darkowlzz and others added 5 commits April 21, 2022 18:59
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Two steps:

1. TestDiffDirectories did not check if the expected only return value
was correct; the intention was there to do so (judging by the
comment "change in order"), but my eye for detail failed me.

2. Reversing the directory comparison in the test revealed bugs in the
comparison code -- in general, it should skip any directory that is
not a directory in the comparator.

To make this easier, the code now keeps track of the expected files it
saw. That means the check for whether an actual file has an expected
counterpart only has two cases, yes or no (rather that trying to
account for whether it's a directory and so on). If a directory was
skipped while scanning the expected files, it won't be in the actual
files anyway.

Signed-off-by: Michael Bridgen <michael@weave.works>
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @darkowlzz

@hiddeco hiddeco added the area/ci CI related issues and pull requests label Apr 26, 2022
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

Great stuff @darkowlzz!

LGTM

@darkowlzz darkowlzz merged commit cd9eaff into main Apr 26, 2022
@darkowlzz darkowlzz deleted the testenv branch April 26, 2022 11:31
@pjbgf pjbgf added this to the GA milestone May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci CI related issues and pull requests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants