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

tweak CONTRIBUTING.md section on tests #155

Merged
merged 1 commit into from
Dec 14, 2023
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
16 changes: 6 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Running end-to-end tests is pretty compute-intensive, and you must convert all t
First, install test dependencies with:

```bash
rye sync --features test
rye sync --features test,conversion
```

Then, download and convert all the necessary weights. Be aware that this will use around 50 GB of disk space:
Expand All @@ -51,24 +51,20 @@ Then, download and convert all the necessary weights. Be aware that this will us
./scripts/prepare-test-weights.sh
```

To run all the tests, you will need to set the following environment variables:
Finally, run the tests:

```bash
export REFINERS_TEST_DEVICE=cuda:0

export REFINERS_TEST_WEIGHTS_DIR=$(pwd)/tests/weights

rye run pytest
```

In particular, `-k` is handy only to run tests that match a given expression, e.g.:
The `-k` option is handy to run a subset of tests that match a given expression, e.g.:

```bash
rye run pytest -k diffusion_std_init_image tests/e2e/test_diffusion.py
rye run pytest -k diffusion_std_init_image
```

You can also run tests that are lightweight and will run on CPU:
You can enforce running tests on CPU. Tests that require a GPU will be skipped.

```bash
rye run pytest -k "not test_diffusion"
REFINERS_TEST_DEVICE=cpu rye run pytest
```