jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
531 stars 299 forks source link

Improve test coverage of kubespawner #313

Open choldgraf opened 5 years ago

choldgraf commented 5 years ago

Given that Kubespawner is a core component of many Jupyter Infra tools (mybinder.org, jupyterhub, binderhub), it'd be great if we could improve the test coverage a bit.

As of creating this issue, we're at 69%, which is a good start! Here's a badge that'll get updated as more tests improve coverage.

codecov

If any folks would like to make improvements to tests, it would be greatly appreciated!

betatim commented 5 years ago

One thing that worked well (even if it required a lot of hard work!) for repo2docker was to use the following codecov check settings:

comment: off
coverage:
  status:
    project:
      default:
        target: auto
    patch:
      default:
         target: 20% 

It prevents the bot from polluting PR discussions with comments and it nudges you to not merge PRs that decrease coverage. It also asks for at least 20% of the lines you changed to be covered.

I think the nudge of "at least don't reduce coverage" has the net result that coverage increases over time. Without being too much of a "you have to eat your vegetables" kind of annoyance.

consideRatio commented 3 years ago

The coverage is ~80% now if we exclude proxy.py that holds the KubeIngressProxy Python class which is separate from KubeSpawner.

Should we have this issue open as an encouragement for additional tests still? What do you think @choldgraf and @betatim?