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

Update testing documentation #275

Merged
merged 15 commits into from
Jan 19, 2025
17 changes: 11 additions & 6 deletions docs/docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,15 @@ the required test and code modules.

You can run all the tests with this command.

```bash
(venv) $ cd /path/to/switchmap
(venv) $ tests/bin/_do_all_tests.py
```
An alternative method is to use pytest.
```bash
(venv) $ cd /path/to/switchmap
(venv) $ pytest tests/switchmap_
```
```
You can run individual tests with this command.
```bash
(venv) $ cd /path/to/switchmap
(venv) $ tests/switchmap_/path/to/test.py
(venv) $ pytest tests/switchmap_/path/to/test.py
```
### Populating the Database Using the Ingester

Expand All @@ -143,3 +139,12 @@ An easy way to populate the database using this data is to:
`cache_directory`
3) Start or restart the poller daemon or app
4) The updated data should now be visible in the web UI

## Running Tests with Coverage Report

To run the test suite and generate a coverage report, use this command:

```bash
(venv) $ cd /path/to/switchmap
(venv) $ pytest --cov=switchmap --cov-report=lcov:coverage/coverage.lcov --cov-report=term-missing tests/switchmap_
```
Loading