Skip to content

Commit

Permalink
Merge pull request CederGroupHub#486 from kamronald/parallelize_tests
Browse files Browse the repository at this point in the history
[WIP] Speed up tests by parallelization using pytest-split
  • Loading branch information
kamronald authored Aug 20, 2024
2 parents b818a2a + 3ef711b commit b3901ed
Show file tree
Hide file tree
Showing 3 changed files with 2,893 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,21 @@ jobs:
# Only 20.04 is known to work with scip 8.0.0
runs-on: ubuntu-20.04
strategy:
max-parallel: 10
#max-parallel: 10
matrix:
python_version: ['3.9', '3.11']
config:
- python: "3.9"
- python: "3.10"
- python: "3.11"

split: [1, 2, 3, 4, 5, 6, 7, 8]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
- name: Set up Python ${{ matrix.config.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
python-version: ${{ matrix.config.python }}

- name: Install dependencies
run: |
Expand All @@ -53,9 +58,9 @@ jobs:
- name: Test with pytest
run: |
pytest tests --cov=smol --cov-report=xml
pytest --splits 8 --group ${{ matrix.split }} --durations-path tests/.test_durations tests
- if: ${{ matrix.python_version == '3.11' && github.event_name == 'push' }}
- if: ${{ matrix.config.python == '3.11' && github.event_name == 'push' }}
name: codacy-coverage-reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ docs = [
test = [
"pytest >=7.2.0",
"pytest-cov >=4.0.0",
"pytest-split>=0.9.0",
"scikit-learn >=1.1.2",
"h5py >=3.10.0",
"coverage",
Expand Down
Loading

0 comments on commit b3901ed

Please sign in to comment.