Skip to content

Commit 42380c3

Browse files
committed
add pytest splits to speedup the notebook testing
1 parent 56b8f3c commit 42380c3

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
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 & 1 deletion
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,4 +38,5 @@ jobs:
3038
- name: Set up memcached
3139
uses: niden/actions-memcached@v7
3240
- name: Test Notebooks
33-
run: tox -e notebook-tests
41+
run: tox -e notebook-tests --splits ${{ inputs.split_size }} --group ${{ inputs.group_number }}
42+

0 commit comments

Comments
 (0)