forked from cheshire-cat-ai/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |