Skip to content

Commit b640386

Browse files
authored
Only run cleanup if tests ran, adds pytest marker config for slow tests (#595)
### Description We don't need to fail the cleanup step if we never ran the tests, this deletes the image from the GPU worker to save space. Also adds the missing pytest marker configuration to our pytest.ini for skipping slow tests. ### Type of changes <!-- Mark the relevant option with an [x] --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Refactor - [ ] Documentation update - [ ] Other (please describe): ### CI Pipeline Configuration Configure CI behavior by checking relevant boxes below. This will automatically apply 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 > [!NOTE] > By default, the notebooks validation tests are skipped unless explicitly enabled. ### Usage <!--- How does a user interact with the changed code --> ```python TODO: Add code snippet ``` ### Pre-submit Checklist <!--- Ensure all items are completed before submitting --> - [ ] I have tested these changes locally - [ ] I have updated the documentation accordingly - [ ] I have added/updated tests as needed - [ ] All existing tests pass successfully --------- Signed-off-by: Peter St. John <pstjohn@nvidia.com>
1 parent f59c602 commit b640386

File tree

5 files changed

+16
-62
lines changed

5 files changed

+16
-62
lines changed

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
- [ ] Other (please describe):
1212

1313
### CI Pipeline Configuration
14-
Configure CI behavior by checking relevant boxes below. This will automatically apply labels.
14+
Configure CI behavior by applying the relevant labels:
1515

16-
- [ ] [SKIP_CI](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#skip_ci) - Skip all continuous integration tests
17-
- [ ] [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
16+
- [SKIP_CI](https://github.com/NVIDIA/bionemo-framework/blob/main/docs/docs/user-guide/contributing/contributing.md#skip_ci) - Skip all continuous integration tests
17+
- [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
1818

1919
> [!NOTE]
2020
> By default, the notebooks validation tests are skipped unless explicitly enabled.

.github/workflows/pr-labels.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/unit-tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "[Optional] BioNemo Image Build and Unit Tests"
1+
name: "BioNemo Image Build and Unit Tests"
22

33
on:
44
pull_request:
@@ -100,6 +100,12 @@ jobs:
100100
BIONEMO_DATA_SOURCE: ngc
101101
run: ./ci/scripts/run_pytest.sh --no-nbval --skip-slow
102102

103+
- name: Run notebook tests
104+
if: ${{ contains(github.event.pull_request.labels.*.name, 'INCLUDE_NOTEBOOKS_TESTS') }}
105+
env:
106+
BIONEMO_DATA_SOURCE: ngc
107+
run: pytest --nbval-lax -p no:python docs/ sub-packages/
108+
103109
- name: Upload coverage to Codecov
104110
uses: codecov/codecov-action@v5
105111
with:
@@ -116,10 +122,9 @@ jobs:
116122
clean-up:
117123
needs: run-tests
118124
runs-on: self-hosted-nemo-gpus-1
119-
if: ${{ always() }}
125+
if: ${{ success() || failure() }}
120126
steps:
121127
- name: clean up image
122128
run: docker rmi nemoci.azurecr.io/bionemo:${{ github.run_id }}
123-
124129
# TODO: exclude tests from base image; run tests from github workspace mounted in the image.
125130
# TODO: figure out way of cleaning up working directory (requires sudo or for us to fix file ownership from release container)

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@
139139
"filename": "pyproject.toml",
140140
"hashed_secret": "79670e9c9d1c7ea5b81a96a2053d81437712c78e",
141141
"is_verified": false,
142-
"line_number": 47
142+
"line_number": 43
143143
}
144144
]
145145
},
146-
"generated_at": "2024-11-01T22:26:03Z"
146+
"generated_at": "2025-01-14T17:26:27Z"
147147
}

pyproject.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ dependencies = [
3636
build = ['flash-attn', 'pip']
3737

3838
[tool.uv.workspace]
39-
members = [
40-
"3rdparty/*",
41-
"sub-packages/bionemo-*/",
42-
"internal/infra-bionemo/",
43-
]
39+
members = ["3rdparty/*", "internal/infra-bionemo/", "sub-packages/bionemo-*/"]
4440

4541
[tool.uv.sources]
4642
# external
@@ -114,9 +110,10 @@ convention = "google"
114110
[tool.pytest.ini_options]
115111
norecursedirs = ["3rdparty"]
116112
addopts = ["--ignore=3rdparty"]
113+
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
117114

118115
[tool.pyright]
119-
include = ["./scripts/", "./sub-packages/", "./internal/"]
116+
include = ["./internal/", "./scripts/", "./sub-packages/"]
120117
exclude = ["*/tests/"]
121118
executionEnvironments = [
122119
{ "root" = ".", pythonVersion = "3.10", extraPaths = [

0 commit comments

Comments
 (0)