Skip to content

Commit

Permalink
Merge pull request #149 from SciCatProject/links-testing-docs
Browse files Browse the repository at this point in the history
Make backend and conftest into links in dev docs
  • Loading branch information
jl-wynen authored Apr 17, 2024
2 parents d144b2d + 768ad38 commit 69f031b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/developer/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ In addition, the fakes are relatively complex and may diverge from the real impl

To mitigate these problems, the fake client is tested alongside a real client.
But to (mostly) avoid the downsides stated in the beginning, the real client is connected to a local SciCat server.
See ``src/testing/backend.py`` and ``tests/conftest.py`` for the concrete setup.
See the `src/scitacean/backend <https://github.com/SciCatProject/scitacean/tree/main/src/scitacean/testing/backend>`_ folder and `tests/conftest.py <https://github.com/SciCatProject/scitacean/blob/main/tests/conftest.py>`_ file for the concrete setup.
The backend is launched in a docker container with the image of the latest release of the SciCat backend.
Tests in ``tests/client`` are then run with both the fake and the real client to ensure that both produce the same results.
Tests in `tests/client <https://github.com/SciCatProject/scitacean/tree/main/tests/client>`_ are then run with both the fake and the real client to ensure that both produce the same results.

Use ``--backend-tests`` with ``pytest`` to run these tests.

SFTP file transfer
------------------

Testing :class:`scitacean.transfer.sftp.SFTPFileTransfer` requires an SFTP server.
``tests/common/sftp_server.py`` contains helpers for managing one via Docker.
:mod:`scitacean.testing.sftp` contains helpers for managing one via Docker.
Tests can use it by depending on the ``sftp_fileserver`` fixture.
See the documentation in ``tests/common/sftp_server.py`` for how it works.
See the `documentation <https://scicatproject.github.io/scitacean/user-guide/testing.html#Local-SFTP-fileserver>`_ for how it works.

Note that those tests may leave a small directory behind.
This is an issue with file ownership and permissions caused by making the Docker volumes writable.
Expand Down

0 comments on commit 69f031b

Please sign in to comment.