Skip to content

Commit 7e27a78

Browse files
Sushma-1706pre-commit-ci[bot]JoeZiminskiadamltyson
authored
docs: add local testing instructions to contributing guide (#665)
* docs: add instructions for running tests locally * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * move to contributing guide, update content. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix headers. * Small improvements Rephrase and clarify instructions for running tests locally, including installation of test dependencies and running specific tests. Improve documentation clarity and consistency throughout. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix link. * Rename to Actions Co-authored-by: Adam Tyson <code@adamltyson.com> * Update docs/source/pages/community/contributing.md Co-authored-by: Adam Tyson <code@adamltyson.com> * Update docs/source/pages/community/contributing.md Co-authored-by: Adam Tyson <code@adamltyson.com> * Update docs/source/pages/community/contributing.md Co-authored-by: Adam Tyson <code@adamltyson.com> * Update docs/source/pages/community/contributing.md Co-authored-by: Adam Tyson <code@adamltyson.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: JoeZiminski <joseph.j.ziminski@gmail.com> Co-authored-by: Joe Ziminski <55797454+JoeZiminski@users.noreply.github.com> Co-authored-by: Adam Tyson <code@adamltyson.com>
1 parent ad8cdc0 commit 7e27a78

1 file changed

Lines changed: 44 additions & 8 deletions

File tree

docs/source/pages/community/contributing.md

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and [opening a pull request](#pull-requests).
1010

1111
The core development team will support you in contributing code, regardless of your experience!
1212

13+
(developer-install)=
1314
## Creating a development environment
1415

1516
For detailed instructions on installing ``datashuttle`` along with
@@ -115,20 +116,55 @@ skip pre-commit checks, and ask for help in your PR.
115116
For docstrings, we adhere to the [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) style.
116117
Make sure to provide docstrings for all public functions, classes, and methods.
117118

118-
## Contributing documentation
119+
## Running tests locally
120+
121+
Unit and integration tests are important tools to ensure the code is working
122+
as expected, and protect against regressions introduced by future changes.
123+
124+
All tests are automatically run on GitHub Actions for open PRs. However, running tests locally can
125+
be useful to verify that everything works correctly on your system. We use [pytest](https://docs.pytest.org/en/stable/)
126+
to manage running `datashuttle` tests.
119127

120-
It is very important that the documentation for ``datashuttle`` is clear,
121-
accurate and concise. A key principle of ``datashuttle`` is it should
122-
make data acquisition simple and easy—therefore it should be
123-
well-documented.
128+
Before running the tests, make sure `datashuttle` is [installed in development mode](developer-install)
129+
130+
### Running the full test suite
131+
132+
From the root of the repository, run:
133+
```bash
134+
pytest
135+
```
136+
This runs all tests that can be executed in the local development environment.
137+
138+
To run a specific test file, you can include the path to the file, for example:
139+
140+
```bash
141+
pytest tests/test_validation.py
142+
```
124143

125-
For these reasons every part of all software must be documented as
126-
thoroughly as possible, and all new features must be fully documented. If you
144+
or to run any tests with names that match a keyword:
145+
146+
```bash
147+
pytest -k validate
148+
```
149+
150+
### Tests requiring additional infrastructure
151+
152+
Some tests depend on external infrastructure and are skipped automatically
153+
when run locally:
154+
155+
- SSH transfer tests require that Docker is installed and running.
156+
- Cloud storage tests (Google Drive, AWS) require private credentials to run
157+
and are generally not expected to be run outside the GitHub Actions environment. Please
158+
contact the development team if you require local testing of Google Drive or AWS for your contribution.
159+
160+
## Contributing documentation
161+
162+
To ensure ease of use, all parts of `datashuttle` must be documented as
163+
thoroughly as possible, and all new features should be fully documented. If you
127164
notice any areas where the documentation can be improved, please don't hesitate
128165
to make a contribution.
129166

130167

131-
132168
### Working with the documentation
133169

134170
The documentation is found in the `docs/source` folder, where the structure mirrors the rendered website.

0 commit comments

Comments
 (0)