Skip to content

Commit 95e340e

Browse files
authored
Merge pull request #1281 from PyAutoLabs/feature/ci-install-nss-extras
ci: split NSS tests into parallel job (handley-lab blackjax fork ≠ mainline)
2 parents 2ddfa62 + 4f85310 commit 95e340e

1 file changed

Lines changed: 57 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@ jobs:
6767
export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoConf
6868
export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoFit
6969
pushd PyAutoFit
70+
# The NSS test suite (test_autofit/non_linear/search/nest/nss/) runs in
71+
# the parallel `unittest_nss` job below — it needs the handley-lab
72+
# blackjax fork from the [nss] extra, which conflicts with the
73+
# blackjax>=1.2.0 mainline pinned in [optional].
7074
if [ "${{ matrix.python-version }}" = "3.13" ]; then
7175
pytest --cov autofit --cov-report xml:coverage.xml \
76+
--ignore=test_autofit/non_linear/search/nest/nss \
7277
--ignore=test_autofit/database/test_file_types.py \
7378
--ignore=test_autofit/non_linear/paths/test_save_and_load.py \
7479
--ignore=test_autofit/aggregator/summary_files/test_aggregate_fits.py \
@@ -81,7 +86,8 @@ jobs:
8186
--deselect "test_autofit/graphical/test_composition.py::test_other_priors[LogUniformPrior]" \
8287
--deselect "test_autofit/mapper/prior/test_prior.py::TestLogUniformPrior::test__non_zero_lower_limit"
8388
else
84-
pytest --cov autofit --cov-report xml:coverage.xml
89+
pytest --cov autofit --cov-report xml:coverage.xml \
90+
--ignore=test_autofit/non_linear/search/nest/nss
8591
fi
8692
- name: Upload coverage to Codecov
8793
uses: codecov/codecov-action@v3
@@ -96,4 +102,54 @@ jobs:
96102
payload: |
97103
{
98104
"text": "${{ github.repository }}/${{ github.ref_name }} (Python ${{ matrix.python-version }}) build result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
105+
}
106+
107+
unittest_nss:
108+
# NSS tests live in their own job because the [nss] extra pins the
109+
# handley-lab/blackjax fork (BSD-3-Clause, ~0.1.0b1.dev85+gef45acd2f),
110+
# which is mutually incompatible with the mainline `blackjax>=1.2.0`
111+
# that the `[optional]` extra (and `test_blackjax_nuts.py`) requires.
112+
# Two envs in parallel keep both test families green without forcing a
113+
# choice between them.
114+
name: NSS tests (fork blackjax)
115+
runs-on: ubuntu-latest
116+
timeout-minutes: 20
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
python-version: ['3.12', '3.13']
121+
steps:
122+
- name: Checkout PyAutoConf
123+
uses: actions/checkout@v4
124+
with:
125+
repository: PyAutoLabs/PyAutoConf
126+
path: PyAutoConf
127+
- name: Checkout PyAutoFit
128+
uses: actions/checkout@v4
129+
with:
130+
path: PyAutoFit
131+
- name: Set up Python ${{ matrix.python-version }}
132+
uses: actions/setup-python@v5
133+
with:
134+
python-version: ${{ matrix.python-version }}
135+
- name: Install dependencies
136+
run: |
137+
pip install --upgrade pip
138+
pip install pytest pytest-cov
139+
pip install ./PyAutoConf "./PyAutoFit[nss]"
140+
- name: Run NSS tests
141+
run: |
142+
export PYTHONPATH=$PWD/PyAutoConf:$PWD/PyAutoFit
143+
pushd PyAutoFit
144+
pytest test_autofit/non_linear/search/nest/nss
145+
- name: Slack send
146+
if: ${{ failure() }}
147+
uses: slackapi/slack-github-action@v1.21.0
148+
env:
149+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
150+
with:
151+
channel-id: C03S98FEDK2
152+
payload: |
153+
{
154+
"text": "${{ github.repository }}/${{ github.ref_name }} NSS tests (Python ${{ matrix.python-version }}) result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
99155
}

0 commit comments

Comments
 (0)