Skip to content

Commit

Permalink
Update tests.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pieroit authored Nov 1, 2024
1 parent 455d415 commit 077d10c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions mkdocs/production/administrators/tests.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
# 🔬 Testing

To run tests, start the Cat as usual.
Tests will run on the same container you already launched, but with mock databases and plugin folder.
Tests will run with mock databases and a mock plugin folder, so your instance will not be impacted.
End to end (e2e) tests are found in `tests/routes`, while all the other folders contain unit tests and mocks / utilities.

## Run all tests

Open another terminal (in the same folder from where you start the Cat) and launch:
Open a terminal in the same folder your Cat is, then launch:

```bash
docker exec cheshire_cat_core python -m pytest --color=yes .
docker compose run --rm cheshire-cat-core python -m pytest --color=yes .
```

## Run a specific test file

If you want to run specific test files and not the whole suite, just specify the path:

```bash
docker exec cheshire_cat_core python -m pytest --color=yes tests/routes/memory/test_memory_recall.py
docker compose run --rm cheshire-cat-core python -m pytest --color=yes tests/routes/memory/test_memory_recall.py
```

## Run a specific test function in a specific test file

You can also launch only one specific test function, using the `::` notation and the name of the function:

```bash
docker exec cheshire_cat_core python -m pytest --color=yes tests/routes/memory/test_memory_recall.py::test_memory_recall_with_k_success
```
docker compose run --rm cheshire-cat-core python -m pytest --color=yes tests/routes/memory/test_memory_recall.py::test_memory_recall_with_k_success
```

0 comments on commit 077d10c

Please sign in to comment.