Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Cleanup and refactor the tests #338

Open
9 tasks
nolar opened this issue Apr 1, 2020 · 0 comments
Open
9 tasks

Cleanup and refactor the tests #338

nolar opened this issue Apr 1, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@nolar
Copy link
Contributor

nolar commented Apr 1, 2020

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant