Skip to content

Commit cbfd9d6

Browse files
committed
check only for psij-slurm when --psij=slurm
1 parent 50c12b2 commit cbfd9d6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/testpsijslurm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
docker exec slurm bash -c "pip install --upgrade pip && pip install -e /pydra[test,psij] && python -c 'import pydra; print(pydra.__version__)'"
4747
- name: Run pytest
4848
run: |
49-
docker exec slurm bash -c "pytest --color=yes -vs --psij=slurm --cov pydra --cov-config /pydra/.coveragerc --cov-report xml:/pydra/cov.xml --doctest-modules /pydra/pydra/ -k 'not test_audit_prov and not test_audit_prov_messdir_1 and not test_audit_prov_messdir_2 and not test_audit_prov_wf and not test_audit_all'"
49+
docker exec slurm bash -c "pytest --color=yes -vs -n auto --psij=slurm --cov pydra --cov-config /pydra/.coveragerc --cov-report xml:/pydra/cov.xml --doctest-modules /pydra/pydra/ -k 'not test_audit_prov and not test_audit_prov_messdir_1 and not test_audit_prov_messdir_2 and not test_audit_prov_wf and not test_audit_all'"
5050
- name: Upload to codecov
5151
run: |
5252
docker exec slurm bash -c "pip install urllib3==1.26.6"

pydra/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def pytest_generate_tests(metafunc):
3030
try:
3131
if metafunc.config.getoption("psij"):
3232
Plugins.append("psij-" + metafunc.config.getoption("psij"))
33+
if bool(shutil.which("sbatch")) and metafunc.config.getoption("psij") == "slurm":
34+
Plugins.remove("slurm")
3335
except ValueError:
3436
pass
3537
metafunc.parametrize("plugin_dask_opt", Plugins)
@@ -49,6 +51,8 @@ def pytest_generate_tests(metafunc):
4951
try:
5052
if metafunc.config.getoption("psij"):
5153
Plugins.append("psij-" + metafunc.config.getoption("psij"))
54+
if bool(shutil.which("sbatch")) and metafunc.config.getoption("psij") == "slurm":
55+
Plugins.remove("slurm")
5256
except ValueError:
5357
pass
5458
metafunc.parametrize("plugin", Plugins)

0 commit comments

Comments
 (0)