Skip to content

Cleanup and refactor the tests #338

@kopf-archiver

Description

@kopf-archiver

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    archiveautomationCI/CD: testing, linting, releasing automatically

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions