Skip to content

Commit

Permalink
Break test suite into smaller sections (#1275)
Browse files Browse the repository at this point in the history
* break the tests into 3 sections

* breakdown by file

* breakdown the mmm tests

* lump few more files in
  • Loading branch information
wd60622 authored Dec 13, 2024
1 parent cca56b4 commit 181b348
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:
pull_request:
branches: [main]
paths:
- ".github/workflows/test.yml"
- "pyproject.toml"
- "tests/**.py"
- "pymc_marketing/**"
push:
branches: [main]
paths:
- ".github/workflows/test.yml"
- "pyproject.toml"
- "tests/**.py"
- "pymc_marketing/**"
Expand All @@ -18,12 +20,18 @@ env:
# The lower bound from the pyproject.toml file
OLDEST_PYMC_VERSION: "$(grep -E 'pymc *>' pyproject.toml | sed -n 's/.*>=\\([0-9]*\\.[0-9]*\\.[0-9]*\\).*/\\1/p')"


jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
config: [ {python-version: "3.10", oldest-pymc: false}, {python-version: "3.12", oldest-pymc: true}]
split:
- "tests/mmm --ignore tests/mmm/test_tvp.py --ignore tests/mmm/test_budget_optimizer.py --ignore tests/mmm/test_hsgp.py --ignore tests/mmm/test_transformers.py"
- "tests/mmm/test_tvp.py tests/mmm/test_budget_optimizer.py tests/mmm/test_hsgp.py tests/mmm/test_transformers.py"
- "tests/clv"
- "--ignore tests/mmm --ignore tests/clv"
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -37,7 +45,7 @@ jobs:
run: |
sudo apt-get install graphviz
pip install -e .[test]
pytest
pytest ${{ matrix.split }}
- name: Check oldest version of PyMC
if: ${{ matrix.config.oldest-pymc }}
run: python -c "import pymc; assert pymc.__version__ == '${{ env.OLDEST_PYMC_VERSION }}'"
Expand All @@ -50,6 +58,13 @@ jobs:

test_slow:
runs-on: ubuntu-latest
strategy:
matrix:
# From referencing https://github.com/pymc-labs/pymc-marketing/issues/1158
split:
- "tests/clv/models/test_beta_geo_beta_binom.py"
- "tests/clv/models/test_pareto_nbd.py"
- "--ignore tests/clv/models/test_beta_geo_beta_binom.py --ignore tests/clv/models/test_pareto_nbd.py"
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -59,7 +74,7 @@ jobs:
- name: Run tests
run: |
pip install -e .[test]
pytest --only-slow
pytest --only-slow ${{ matrix.split }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down

0 comments on commit 181b348

Please sign in to comment.