Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Add full list of custom pytest flags to test README #166

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,30 @@ The custom optional flag `--outdir="OUT"` is recommended
to produce output figures, data dumps and logs and save them in the directory `"OUT"`.
The value `"."` can be used to save these in the current directory.

Tests which require a “significant” amount of memory (<16GB RAM) are disabled by default.
In total, the following custom pytest command line flags are defined by PyDRex:
- `--outdir` (described above)
- `--runbig` (enable tests which require a large amount of RAM)
- `--runslow` (enable slow tests which require HPC resources, implies `--runbig`)
- `--ncpus` (number of CPU cores to use for shared memory multiprocessing, set to one less than the available maximum by default)
- `--fontsize` (Matplotlib `rcParams["font.size"]`)
- `--markersize` (Matplotlib `rcParams["lines.markersize"]`)
- `--linewidth` (Matplotlib `rcParams["lines.linewidth"]`)

Tests which require a “significant” amount of memory (> ~16GB RAM) are disabled by default.
To fully check the functionality of the code, it is recommended to run these locally
by using the `--runbig` flag before moving to larger simulations.
To mark a test as “big”, add the `@pytest.mark.big` decorator above its method definition.

Long tests/examples are also disabled by default and can be enabled with `--runslow`.
It is recommended to run these on a HPC cluster infrastructure (>100GB RAM, >46 cores).
To mark a test as slow, add the `@pytest.mark.slow` decorator above its method definition.
It is recommended to run these on a HPC cluster infrastructure (>100GB RAM, >32 cores).
The number of cores to use for shared memory multiprocessing can be specified with `--ncpus`.

## Writing tests

- To mark a test as “big” (i.e. requiring more than ~16GB RAM), apply the
`@pytest.mark.big` decorator to the corresponding method definition.

- To mark a test as “slow” (i.e. requiring more than ~32 cores), apply the
`@pytest.mark.slow` decorator to the corresponding method definition.

Tests should not produce persistent output by default.
If a test method can produce such output for debugging or visualisation,
Expand Down
Loading