Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMelt committed Jan 13, 2024
1 parent 512288e commit b227c6b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 14 deletions.
49 changes: 36 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,51 @@ sure they pass before submitting your PR. Furthermore, please write tests for an
You can run the existing tests (and your new ones) with the following command:

```shell
$ pytest -v tests/
$ pytest --cov-report term-missing --cov=mdb -vv tests/
```

You should see something like this:
The coverage report (`--cov-report term-missing`) will help ensure that new features are added with tests. You should see
something like this:

```shell
$ pytest -v tests/
$ pytest --cov-report term-missing --cov=mdb -vv tests/
=========================================================== test session starts ============================================================
platform linux -- Python 3.12.0, pytest-7.4.4, pluggy-1.3.0 -- path/to/python
platform linux -- Python 3.12.0, pytest-7.4.4, pluggy-1.3.0 -- /home/melt/miniconda3/envs/mdb/bin/python
cachedir: .pytest_cache
rootdir: path/to/mdb
rootdir: /home/melt/sync/cambridge/projects/side/mdb
plugins: cov-4.1.0
collected 3 items

tests/test_utils.py::test_parse_ranks PASSED [ 33%]
tests/test_utils.py::test_strip_functions PASSED [ 66%]
tests/test_utils.py::test_print_tabular_output PASSED [100%]

============================================================ 3 passed in 0.01s =============================================================
collected 5 items

tests/test_integration.py::test_mdb_simple PASSED
[ 20%]
tests/test_integration.py::test_mdb_timeout PASSED
[ 40%]
tests/test_utils.py::test_parse_ranks PASSED
[ 60%]
tests/test_utils.py::test_strip_functions PASSED
[ 80%]
tests/test_utils.py::test_print_tabular_output PASSED
[100%]

---------- coverage: platform linux, python 3.12.0-final-0 -----------
Name Stmts Miss Cover Missing
-------------------------------------------------
mdb/__init__.py 0 0 100%
mdb/mdb.py 8 0 100%
mdb/mdb_attach.py 34 2 94% 89-90
mdb/mdb_client.py 71 3 96% 16-18, 114
mdb/mdb_launch.py 39 13 67% 44-50, 56-67
mdb/mdb_shell.py 219 54 75% 30-33, 72-89, 108-110, 123-146, 173-174, 201-206, 284-285, 300-307, 378, 390, 454-455
mdb/utils.py 16 0 100%
-------------------------------------------------
TOTAL 387 72 81%


============================================================ 5 passed in 13.97s ============================================================
```

The key point is all tests should pass.
The key point is all tests should pass and `TOTAL` coverage should stay above 60%. If the coverage drops below 60% then the
GitHub CI will fail.

## Coding conventions

Expand Down
5 changes: 4 additions & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ quality of the code. Please also familiarize yourself with the `CONTRIBUTING.md
<https://github.com/TomMelt/mdb/blob/main/CONTRIBUTING.md>`_ guide, for more details on how to best
contribute to ``mdb``.

The additional ``develop`` dependencies are, ``black``, ``flake8`` and ``mypy``.
The additional ``develop`` dependencies are;

* `black <https://black.readthedocs.io/en/stable>`_ is used for formatting the source code.
* `flake8 <https://flake8.pycqa.org/en/latest>`_ is used to check the style and quality of some
python code.
* `mypy <https://mypy.readthedocs.io/en/stable>`_ is a static type checker and is used to help
ensure that variables and functions are being used correctly.
* `pytest <https://docs.pytest.org/en/7.4.x/>`_ for creating and running unit and integration tests
* `pytest-cov <https://pytest-cov.readthedocs.io/en/latest/index.html>`_ for producing coverage
reports.

0 comments on commit b227c6b

Please sign in to comment.