Skip to content

Commit e4a0170

Browse files
Update contributing.md (#397)
2 parents 0c6940d + 46b0172 commit e4a0170

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/contributing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ out to the developers of the dependency before the package is released to a wide
7878

7979
[scanpy-test-docs]: https://scanpy.readthedocs.io/en/latest/dev/testing.html#writing-tests
8080

81+
### Testing the correctness of the plots
82+
83+
Many tests will produce plots and check that they are correct by comparing them with a previously saved and serialized version of the same plots. The ground truth images are located in `tests/_images`. Different OS/versions may produce similar but not identical plots (for instance the ticks/padding could vary). To take into account for this please consider the following:
84+
85+
- you should not use locally generated plots as ground truth images, but you should commit images that have been generated by a GitHub Action. The recommended workflow is to go to the ["actions" page for the repo](https://github.com/scverse/spatialdata-plot/actions/workflows/test.yaml), download the artifacts, and upload them as ground truth (after having reviewed them).
86+
- the ground truth images need to be updated when a new test is passing, or when a test starts producing a slightly different (but consistent) plot.
87+
- please never replace the ground truth images without having manually reviewed them.
88+
- if you run the tests locally in macOS or Windows they will likely fail because the ground truth images are generated using Ubuntu. To overcome this you can use `act`, which will generate a Docker reproducing the environment used in the GitHub Action. After the Docker container is generated you can use it within IDEs to run tests and debug code.
89+
- in the case of PyCharm, it is easier to create a container from a `Dockerfile` instead of using `act`. Please in such case use the `Dockerfile` made availabel in the repository. If you encountering problems with `act` or `docker`, please [get in touch with the developers via Zulip](https://scverse.zulipchat.com/#narrow/channel/443514-spatialdata-dev) and we will help troubleshoot the issue. See also additional details [here](https://github.com/scverse/spatialdata-plot/pull/397).
90+
8191
## Publishing a release
8292

8393
### Updating the version number

0 commit comments

Comments
 (0)