From 181b34885c86cee1902d375c04904dec77583f90 Mon Sep 17 00:00:00 2001 From: Will Dean <57733339+wd60622@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:13:33 +0100 Subject: [PATCH] Break test suite into smaller sections (#1275) * break the tests into 3 sections * breakdown by file * breakdown the mmm tests * lump few more files in --- .github/workflows/test.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb239b0ac..4497f070f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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/**" @@ -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 @@ -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 }}'" @@ -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 @@ -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: