Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make backend and conftest into links in dev docs #149

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the paths to the files below are out of date. There is no tests/common/sftp_server.py in the repo I think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Those files are now packaged with Scitacean and are now in

:mod:`scitacean.testing.sftp`

Can you update the paths to this? I don't think we need to refer to any concrete files in this case but to the user guide in https://scicatproject.github.io/scitacean/user-guide/testing.html#Local-SFTP-fileserver

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this statement still true?

Tests can use it by depending on the sftp_fileserver fixture.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading