Skip to content

Commit

Permalink
docs: added some notes on how to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rmm-ch committed Jan 17, 2025
1 parent eaa1c71 commit 16fcc83
Showing 1 changed file with 46 additions and 4 deletions.
50 changes: 46 additions & 4 deletions docs/dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ We set this up so it is hosted as a huggingface space. Each commit to `main` tri
For local testing, assuming you have all the required packages installed in a
conda env or virtualenv, and that env is activated:

```
```bash
cd src
streamlit run main.py
```
Expand All @@ -17,15 +17,17 @@ We have a CI action to presesnt the docs on github.io.
To validate locally, you need the deps listed in `requirements.txt` installed.

Run
```
```bash
mkdocs serve
```

And navigate to the wish server running locally, by default: http://127.0.0.1:8888/

This automatically watches for changes in the markdown files, but if you edit the
something else like the docstrings in py files, triggering a rebuild in another terminal
refreshes the site, without having to quit and restart the server.
```

```bash
mkdocs build -c
```

Expand All @@ -37,4 +39,44 @@ mkdocs build -c

# Set up a conda env

(Standard stuff)
(Standard stuff)


# Testing

## local testing
To run the tests locally, we have the standard dependencies of the project, plus the test runner dependencies.

```bash
pip install -r tests/requirements.txt
```

(If we migrate to using toml config, the test reqs could be consolidated into an optional section)


**Running tests**
from the project root, simply run:

```bash
pytest
# or pick a specific test file to run
pytest tests/test_whale_viewer.py
```

To generate a coverage report to screen (also run the tests):
```bash
pytest --cov=src
```

To generate reports on pass rate and coverage, to files:
```bash
pytest --junit-xml=test-results.xml
pytest --cov-report=lcov --cov=src
```


## CI testing

Initially we have an action setup that runs all tests in the `tests` directory, within the `test/tests` branch.

TODO: Add some test report & coverage badges to the README.

0 comments on commit 16fcc83

Please sign in to comment.