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

Cleanup and refactor the tests #338

Open
9 tasks
kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Open
9 tasks

Cleanup and refactor the tests #338

kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Labels
archive automation CI/CD: testing, linting, releasing automatically

Comments

@kopf-archiver
Copy link

kopf-archiver bot commented Aug 18, 2020

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 mypy over 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archive automation CI/CD: testing, linting, releasing automatically
Projects
None yet
Development

No branches or pull requests

1 participant