Skip to content

Commit

Permalink
add testing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ieivanov committed Jun 7, 2023
1 parent 5b2527d commit 0ba31e4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,25 @@ git config --global user.email [email protected]

Make sure your fork stays up-to-date with the latest changes in the main repo by [syncing your fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork).

## Testing the code

We use the [pytest](https://docs.pytest.org/) framework to test the code. During development, you can run the tests locally using

```sh
# in the project root directory
pytest -v
```

The suite of [tests](https://github.com/micro-manager/pycro-manager/tree/main/pycromanager/test) also runs automatically using [GitHub Actions](https://github.com/micro-manager/pycro-manager/actions) for every PR. All tests must pass before a PR is merged. Please contribute new tests as you fix bugs and develop new features.

Execution of the `pycro-manager` tests depends on [Micro-manager](https://micro-manager.org/) and several Java libraries ([AcqEngJ](https://github.com/micro-manager/AcqEngJ), [NDTiffStorage](https://github.com/micro-manager/NDTiffStorage), [NDViewer](https://github.com/micro-manager/NDViewer)).

During setup, `pytest` will download the latest [nightly build](https://micro-manager.org/Micro-Manager_Nightly_Builds) of `Micro-manager` and install it in `~/Micro-Manager-nightly`; this step will be skipped if that folder exists. Currently installation of the latest `Micro-manager` nightly build through `pytest` is only supported on Windows platforms. For other platforms, please manually install a working version of `Micro-manager` in `~/Micro-Manager-nightly`.

During setup, `pytest` will also look for pre-compiled `.jar` files in the `../../{java_lib_name}/target` directory (e.g. `../../{AcqEngJ}/target`) and replace the ones that are packaged with the `Micro-manager` nightly build if they are older version. This is helpful when co-developing these libraries. The user does need to pre-compile the Java libraries first. When the tests run in GitHub Actions they always use with the `.jar` files that are packaged with `Micro-manager`.

Tests of the `pycro-manager` NDViewer and `napari` viewer only execute locally and are skipped by GitHub Actions. When making changes that may affect these viewer, please make sure to always run the tests locally.

## Building the docs

1) Add/edit files in the `docs/source` directory
Expand Down

0 comments on commit 0ba31e4

Please sign in to comment.