From e6b246379e27d1c638b810f46e657e0ea3d40579 Mon Sep 17 00:00:00 2001 From: jon r Date: Sat, 22 Feb 2025 23:57:32 +0100 Subject: [PATCH] docs(developer/contribute): add Sphinx anchors --- docs/developer/contribute/api.md | 5 +++++ docs/developer/contribute/frontend.md | 5 +++++ docs/developer/setup/docker.md | 32 +++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/docs/developer/contribute/api.md b/docs/developer/contribute/api.md index c9bfd07f8..4f8099734 100644 --- a/docs/developer/contribute/api.md +++ b/docs/developer/contribute/api.md @@ -129,8 +129,13 @@ def test_downgrade_not_superuser_skips_email(factories, mocker): mocked_notify.assert_not_called() ``` + + +(runtests)= ## Run tests + + You can run all tests in the pytest suite with the following command: ```sh diff --git a/docs/developer/contribute/frontend.md b/docs/developer/contribute/frontend.md index e4a8a29b3..d162a321a 100644 --- a/docs/developer/contribute/frontend.md +++ b/docs/developer/contribute/frontend.md @@ -59,8 +59,13 @@ yarn dev:docs - Find more details about the UI library and [how to contributein the live docs](http://localhost:5173/contributing) + + +(testing)= ## Testing + + ### Unit tests The Funkwhale frontend contains some tests to catch errors before changes go live. The coverage is still fairly low, so we welcome any contributions. diff --git a/docs/developer/setup/docker.md b/docs/developer/setup/docker.md index 283259ecc..a0ffc1e55 100644 --- a/docs/developer/setup/docker.md +++ b/docs/developer/setup/docker.md @@ -424,3 +424,35 @@ Fallback ports are available for the documentation at Maintain their life cycle with similar commands to those used to [set up auxiliary services (point 2.)](#set-up-auxiliary-services). + +## Running the test suites + +Run the App test suite: + +```sh +docker compose run --rm front yarn test +``` + +Run the App tests with coverage: + +```sh +docker compose run --rm front yarn test:unit +``` + + +Please also see the [Testing](<#testing>) in the App contributing guidelines. + +Run the API test suite: + +```sh +docker compose run --rm api pytest +``` + +Run a single test: + +```sh +docker compose run --rm api pytest tests/music/test_models.py +``` + + +Please also see [Run tests](<#runtests>) in the API contributing guidelines.