openfisca / country-template

Start modelling the tax and benefit system of your country in a few minutes.
https://legislation.demo.openfisca.org
GNU Affero General Public License v3.0
31 stars 15 forks source link

Smoke test the Web API #112

Closed MattiSG closed 3 years ago

MattiSG commented 3 years ago

There was a production incident last week on OpenFisca France, where an inadequate config key prevented the Web API from starting altogether. This would have been caught if the CI had a small test for the web API.

I thus suggest to add a smoke test to the web API, which will check:

  1. The API starts with openfisca serve.
  2. Accessing the swagger endpoint returns an HTTP 200 code.
  3. The result of the swagger endpoint is valid JSON.

This test result should appear as a dedicated step in each PR, along with check_version_and_changelog or lint_yaml_files.