-
Notifications
You must be signed in to change notification settings - Fork 65
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
Testenv test refactor #221
Testenv test refactor #221
Commits on Nov 11, 2021
-
Add testenv TestMain and move ginkgo to legacy
Add new testenv based TestMain in suite_test.go and move the ginkgo test setup to legacy_suite_test.go. This helps to run both the ginkgo tests and testenv based tests. Signed-off-by: Sunny <darkowlzz@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for 31b304d - Browse repository at this point
Copy the full SHA 31b304dView commit details -
controllers/update_test.go: Update to use testenv
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for 3b131ba - Browse repository at this point
Copy the full SHA 3b131baView commit details -
update pkg/test and pkg/update with testenv
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for 3a03fad - Browse repository at this point
Copy the full SHA 3a03fadView commit details -
All the tests use testenv. Remove legacy envtest suite_test. Signed-off-by: Sunny <darkowlzz@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for 11dfea5 - Browse repository at this point
Copy the full SHA 11dfea5View commit details -
Update tests to be compatible with CR > v0.10.0
In controller-runtime v0.10.0, the client is updated to clean any stale data in the target object when performing any operation. This results in test failure for the code that constructs an object with both spec and status, and creates the object and updates status it with the same object. The fix is to set the status separately on the object before updating it. Refer: kubernetes-sigs/controller-runtime#1640 Signed-off-by: Sunny <darkowlzz@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for f415d86 - Browse repository at this point
Copy the full SHA f415d86View commit details -
Correct directory diffing test and algorithm
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>
Configuration menu - View commit details
-
Copy full SHA for 8a36a79 - Browse repository at this point
Copy the full SHA 8a36a79View commit details -
Restructure tests in update_test.go
Restructures the tests in update_test.go to separate the individual checks into separate tests with helpers for common operations. Signed-off-by: Sunny <darkowlzz@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for b8c9f43 - Browse repository at this point
Copy the full SHA b8c9f43View commit details -
Add testWithRepoAndImagePolicy() in update_test.go
testWithRepoAndImagePolicy() contains common code to create a git server, git repository and ImagePolicy for the test setup. Also updates some test structure slightly. Signed-off-by: Sunny <darkowlzz@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for 5ae1d28 - Browse repository at this point
Copy the full SHA 5ae1d28View commit details -
Reduce higher-order function in test template
This is just a cosmetic thing -- there's no need for the higher-order func used to create mini test suites, given the protocol and git implementation. This made the Gingko version clearer, arguably, but it can be reduced away here for a bit less nesting. Signed-off-by: Michael Bridgen <michael@weave.works>
Configuration menu - View commit details
-
Copy full SHA for f4b89bd - Browse repository at this point
Copy the full SHA f4b89bdView commit details -
This tidies the random string testWithRepoAndImagePolicy() arguments into a struct, which reduces clutter (and the chance of getting them in the wrong order) in invocations. Signed-off-by: Michael Bridgen <michael@weave.works>
Configuration menu - View commit details
-
Copy full SHA for dd81020 - Browse repository at this point
Copy the full SHA dd81020View commit details -
update_test: Create ImagePolicy per subtest
In TestImageUpdateAutomation_e2e, move the ImagePolicy to be created per subtest and not shared in the common test environment. This makes the tests more independent of each other. Signed-off-by: Sunny <darkowlzz@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for 8b96c15 - Browse repository at this point
Copy the full SHA 8b96c15View commit details