Here are frequently asked questions.
Contents
Health checks and unit tests look like each other: they both perform assertions, in order to return some “ok” or “error” binary information to the user.
Moreover, in Python ecosystem, many tools deal with tests, and community is used to testing.
So, in order to make health checks easy and powerful, they were created as a special kind of tests. Moreover, this design requires small code, since most implementations already exist.
The main difference is the use case.
Unit tests:
Whereas health checks:
As an example:
It is nearly the same answer than What is the difference between health checks and unit tests? above...
Integration tests make sure some components can work together, in dedicated environments, with dummy data and users...
Whereas health checks actually check the status of running applications.
Smoke tests are a kind of health checks.
Smoke tests are light and quick operations that return feedback. They are the health checks you usually run (and setup) first.
Then, other health checks can give you more details, so that you get a better diagnosis.
When smoke tests return positive feedback (i.e. everything seems alright), it may be useless to run deeper tests. Else, if some smoke test returns negative feedback (there is something wrong), then additional health checks may provide more details. This is what hospital calls a diagnosis scenario.