Skip to content

Commit a2d3eae

Browse files
Merge pull request #550 from aai-institute/fix-notebook-tests
Fix notebook tests
2 parents d40e8e2 + 24d55d9 commit a2d3eae

File tree

9 files changed

+141
-104
lines changed

9 files changed

+141
-104
lines changed

.github/workflows/main.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,16 @@ jobs:
8585

8686
notebook-tests:
8787
strategy:
88+
fail-fast: false
8889
matrix:
8990
python_version: ["3.8", "3.9", "3.10", "3.11"]
90-
name: Run Notebook tests - Python ${{ matrix.python_version }}
91+
group_number: [1, 2, 3, 4]
92+
name: Run Notebook tests - Python ${{ matrix.python_version }} - Group ${{ matrix.group_number }}
9193
uses: ./.github/workflows/run-notebook-tests-workflow.yaml
9294
with:
9395
python_version: ${{ matrix.python_version }}
96+
split_size: 4
97+
group_number: ${{ matrix.group_number }}
9498
needs: [code-quality]
9599

96100
push-docs-and-release-testpypi:

.github/workflows/run-notebook-tests-workflow.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ name: Run Notebook Tests
33
on:
44
workflow_call:
55
inputs:
6+
split_size:
7+
description: "Determines the number of groups into which the tests should be split"
8+
type: string
9+
default: 4
10+
group_number:
11+
description: "Determines which which group of tests to run. Can be 1, 2, ..., split_size"
12+
type: string
13+
required: true
614
python_version:
715
description: "Determines which Python version to use"
816
type: string
@@ -30,5 +38,5 @@ jobs:
3038
- name: Set up memcached
3139
uses: niden/actions-memcached@v7
3240
- name: Test Notebooks
33-
run: tox -e notebook-tests
34-
continue-on-error: true
41+
run: tox -e notebook-tests -- --durations-path .notebook_test_durations --splits ${{ inputs.split_size }} --group ${{ inputs.group_number }}
42+

.notebook_test_durations

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"notebooks/data_oob.ipynb::": 14.608769827000287,
3+
"notebooks/influence_imagenet.ipynb::": 13.570316236000508,
4+
"notebooks/influence_sentiment_analysis.ipynb::": 20.546479973001624,
5+
"notebooks/influence_synthetic.ipynb::": 5.9324631089984905,
6+
"notebooks/influence_wine.ipynb::": 16.114133220999065,
7+
"notebooks/least_core_basic.ipynb::": 14.312467472000208,
8+
"notebooks/shapley_basic_spotify.ipynb::": 15.608795123000164,
9+
"notebooks/shapley_knn_flowers.ipynb::": 3.9430189769991557,
10+
"notebooks/shapley_utility_learning.ipynb::": 26.96671833400069
11+
}

notebooks/influence_sentiment_analysis.ipynb

Lines changed: 61 additions & 49 deletions
Large diffs are not rendered by default.

notebooks/influence_wine.ipynb

Lines changed: 40 additions & 38 deletions
Large diffs are not rendered by default.

notebooks/least_core_basic.ipynb

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tox<4.0.0
22
tox-wheel
33
pre-commit==3.1.1
4-
black[jupyter] == 23.1.0
4+
black[jupyter] == 24.3.0
55
isort == 5.12.0
66
pylint==3.1.0
77
pylint-json2html==0.5.0

requirements-notebooks.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
datasets==2.14.6
2-
distributed==2024.4.0
3-
pillow==10.0.1
2+
distributed==2023.4.0
3+
pillow==10.3.0
44
torch==2.0.1
55
torchvision==0.15.2
66
transformers==4.36.0
7-
zarr==2.17.1
7+
zarr==2.16.1

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ deps =
2424
{[testenv]deps}
2525
-r requirements-notebooks.txt
2626
commands =
27-
pytest --nbmake --nbmake-timeout=30 -n 0 --cov "{envsitepackagesdir}/pydvl" notebooks/ {posargs}
27+
pytest --nbmake --nbmake-timeout=60 -n 0 --cov "{envsitepackagesdir}/pydvl" notebooks/ {posargs}
2828

2929
[testenv:linting]
3030
skip_install = true

0 commit comments

Comments
 (0)