-
Notifications
You must be signed in to change notification settings - Fork 190
Cleanup and refactor the tests #338
Copy link
Copy link
Open
Labels
archiveautomationCI/CD: testing, linting, releasing automaticallyCI/CD: testing, linting, releasing automatically
Description
An issue by nolar at 2020-04-01 08:10:41+00:00
Original URL: zalando-incubator/kopf#338
Problem
Over the year of active development, the tests are in a clumsy state with lots of inconsistencies. It is time to refactor them (with one or more iterations).
Proposal
The following is a collection of things to improve. Feel free to add ideas to comments.
- Run e2e tests in pristine-clean environments. Revise the e2e testing for pristine-clean environments #253
- Get rid of time-dependent tests. Use mocked time. Stabilise the time-based tests with asyncio sleeps/timeouts #212
- Get rid of mocks where possible. Use dependency injections.
- Add the tests for version upgrades.
- Extract the testing tools as project-local plugins, add type-checks to the tooling (not exposed for the users like
kopf.testing!). - Wrap various dicts/values in tests with proper classes, to remove IDE typing warnings.
- (?) Add typing to pytest fixtures in the tests (for IDEs).
- (?) Run
mypyover the tests (non-strict, perhaps). - Switch assertions of function calls to
assert ...call_args_list == [call(*args, **kwargs)]syntax (now:assert k8s_mocked.sleep_or_wait.call_args_list[0][0][0] is None)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
archiveautomationCI/CD: testing, linting, releasing automaticallyCI/CD: testing, linting, releasing automatically