From 149d7bd1cedd45ded09c946dcc2cf07180820c21 Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Fri, 29 Sep 2023 13:20:03 +0200 Subject: [PATCH 1/3] make backend and conftest into links --- docs/developer/testing.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/developer/testing.rst b/docs/developer/testing.rst index 8e1f08dc..7ca7b304 100644 --- a/docs/developer/testing.rst +++ b/docs/developer/testing.rst @@ -21,12 +21,18 @@ 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 |backend folder|_ folder and |conftest 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. Use ``--backend-tests`` with ``pytest`` to run these tests. +.. |backend folder| replace:: ``src/scitacean/backend`` +.. _backend folder: https://github.com/SciCatProject/scitacean/tree/main/src/scitacean/testing/backend + +.. |conftest file| replace:: ``tests/conftest.py`` +.. _conftest file: https://github.com/SciCatProject/scitacean/blob/main/tests/conftest.py + SFTP file transfer ------------------ From 10cec1ec96aa833e253a256a92ee8dc88af3f20b Mon Sep 17 00:00:00 2001 From: Neil Vaytet <39047984+nvaytet@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:46:12 +0200 Subject: [PATCH 2/3] Update testing.rst --- docs/developer/testing.rst | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/developer/testing.rst b/docs/developer/testing.rst index 7ca7b304..a26d7bf5 100644 --- a/docs/developer/testing.rst +++ b/docs/developer/testing.rst @@ -21,18 +21,12 @@ 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 the |backend folder|_ folder and |conftest file|_ for the concrete setup. +See the `src/scitacean/backend `_ folder and `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 `_ 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. -.. |backend folder| replace:: ``src/scitacean/backend`` -.. _backend folder: https://github.com/SciCatProject/scitacean/tree/main/src/scitacean/testing/backend - -.. |conftest file| replace:: ``tests/conftest.py`` -.. _conftest file: https://github.com/SciCatProject/scitacean/blob/main/tests/conftest.py - SFTP file transfer ------------------ From 768ad38a6f0b4378a8e08691610d6a04a5b1bff2 Mon Sep 17 00:00:00 2001 From: Neil Vaytet <39047984+nvaytet@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:24:51 +0200 Subject: [PATCH 3/3] Update links for SFTP file transfer --- docs/developer/testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/developer/testing.rst b/docs/developer/testing.rst index a26d7bf5..97ba7d1c 100644 --- a/docs/developer/testing.rst +++ b/docs/developer/testing.rst @@ -31,9 +31,9 @@ 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 `_ 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.