Skip to content

Commit

Permalink
Update testing documentation (#275)
Browse files Browse the repository at this point in the history
* Update workflows

* Minor changes

* rerun tests

* minor fix

* Deleted _do_all_tests.py script from tests/bin directory

* add doc string workflow

* Changed path for storing coverage report

* fix minor issue

* removed unwanted code

* Update testing documentation

---------

Co-authored-by: im-vedant <[email protected]>
  • Loading branch information
im-vedant and im-vedant authored Jan 19, 2025
1 parent 63f224c commit c4dd835
Showing 1 changed file with 11 additions and 6 deletions.
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_
```

0 comments on commit c4dd835

Please sign in to comment.