Skip to content

Commit

Permalink
docs: add information about approval tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasschaub committed May 27, 2024
1 parent 50b3961 commit a8c9f91
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/development-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ celery --app sketch_map_tool.tasks worker --loglevel=INFO

```bash
mamba activate smt
pybabel compile -d sketch_map_tool/translations
flask --app sketch_map_tool/routes.py --debug run
# Go to http://127.0.0.1:5000
```
Expand Down Expand Up @@ -102,6 +103,19 @@ To run all tests:
pytest
```

Some test are using the [Approval Testing methodology](https://approvaltests.com/).
Approval tests capture the output (snapshot) of a piece of code and compare it
with a previously approved version of the output.

Once the output has been *approved* then as long as the output stays the same the
test will pass. A test fails if the *received* output is not identical
to the approved version. In this case, the difference of the received and the
approved output is reported to the tester.

In the case of the Sketch Map Tool the report takes the form of two images
side-by-side, the uploaded sketch map with markings (input) and the resulting
GeoJSON with the detected markings.

#### Integration Tests

The integration test suite utilizes the Testcontainers framework to run unique instances of Redis and Postgres for each test session. It also configures and starts Flask and Celery workers in the background.
Expand Down

0 comments on commit a8c9f91

Please sign in to comment.