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

added slow test label and execute full testing suite before merge #634

Merged
merged 16 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Configure CI behavior by applying the relevant labels:

- [SKIP_CI](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#skip_ci) - Skip all continuous integration tests
- [INCLUDE_NOTEBOOKS_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_notebooks_tests) - Execute notebook validation tests in pytest
- [INCLUDE_SLOW_TESTS](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#include_slow_tests) - Execute tests labelled as slow in pytest for extensive testing


> [!NOTE]
> By default, the notebooks validation tests are skipped unless explicitly enabled.
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,25 @@ jobs:
path: ${{ github.run_id }}

- name: Run tests
# Tests in this stage generate code coverage metrics for the repository
# Coverage data is uploaded to Codecov in subsequent stages
env:
BIONEMO_DATA_SOURCE: ngc
run: ./ci/scripts/run_pytest.sh --no-nbval --skip-slow

- name: Run slow tests
if: |
github.event_name == 'merge_group' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'INCLUDE_SLOW_TESTS'))
env:
BIONEMO_DATA_SOURCE: ngc
run: pytest -m "slow" sub-packages/

- name: Run notebook tests
if: ${{ contains(github.event.pull_request.labels.*.name, 'INCLUDE_NOTEBOOKS_TESTS') }}
if: |
github.event_name == 'merge_group' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'INCLUDE_NOTEBOOKS_TESTS'))
env:
BIONEMO_DATA_SOURCE: ngc
run: pytest --nbval-lax -p no:python docs/ sub-packages/
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/user-guide/contributing/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ Key behaviors:
- Use when modifying notebooks or notebook-related code
- Disabled by default

#### **INCLUDE_SLOW_TESTS**

- Enables unit tests labelled as slow ie CLI tests
- Use when modifying core functionalities and require extensive, end-2-end, testing
- Disabled by default

### Developer workflows

You should always carefully test your changes. Run `pytest ...` in your container locally. All tests are done via `pytest`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ def test_nemo2_conversion_equivalent_650m(tmp_path):
model_tag = "facebook/esm2_t33_650M_UR50D"
module = biobert_lightning_module(config=ESM2Config())
io.import_ckpt(module, f"hf://{model_tag}", tmp_path / "nemo_checkpoint")
assert_model_equivalence(tmp_path / "nemo_checkpoint", model_tag)
with megatron_parallel_state_utils.distributed_model_parallel_state():
assert_model_equivalence(tmp_path / "nemo_checkpoint", model_tag, atol=1e-4, rtol=1e-4)
Loading