Skip to content

Commit 5035284

Browse files
committed
add testing for psij
1 parent 6b4e098 commit 5035284

File tree

4 files changed

+58
-15
lines changed

4 files changed

+58
-15
lines changed

.github/workflows/testpsij.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: PSI/J
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
test:
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest, macos-latest]
21+
python-version: ['3.9', '3.10', '3.11']
22+
fail-fast: false
23+
runs-on: ${{ matrix.os }}
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
repository: ${{ github.repository }}
30+
31+
- name: Setup Python version ${{ matrix.python-version }}
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Install dependencies for PSI/J
37+
run: |
38+
pip install -e ".[test,psij]"
39+
40+
- name: Run tests for PSI/J
41+
run: |
42+
pytest --color=yes -vs -n auto pydra/engine --cov pydra --cov-config .coveragerc --cov-report xml:cov.xml
43+
44+
- name: Upload to codecov
45+
run: codecov -f cov.xml -F unittests -e GITHUB_WORKFLOW

.github/workflows/testslurm.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ on:
88

99
jobs:
1010
build:
11-
strategy:
12-
matrix:
13-
python-version: [3.8.16, 3.9.16, 3.10.9, 3.11.5]
14-
fail-fast: false
1511
runs-on: ubuntu-latest
1612
env:
17-
DOCKER_IMAGE: adi611/docker-centos7-slurm:23.02.1
13+
DOCKER_IMAGE: giovtorres/docker-centos7-slurm:latest
1814

1915
steps:
2016
- name: Disable etelemetry
@@ -28,7 +24,10 @@ jobs:
2824
- name: Display previous jobs with sacct
2925
run: |
3026
echo "Allowing ports/daemons time to start" && sleep 10
31-
docker exec slurm bash -c "sacctmgr -i add account none,test Cluster=linux Description='none' Organization='none'"
27+
docker exec slurm bash -c "sacctmgr -i add cluster name=linux \
28+
&& supervisorctl restart slurmdbd \
29+
&& supervisorctl restart slurmctld \
30+
&& sacctmgr -i add account none,test Cluster=linux Description='none' Organization='none'"
3231
docker exec slurm bash -c "sacct && sinfo && squeue" 2&> /dev/null
3332
if [ $? -ne 0 ]; then
3433
echo "Slurm docker image error"
@@ -39,16 +38,12 @@ jobs:
3938
docker exec slurm bash -c "echo $NO_ET"
4039
docker exec slurm bash -c "ls -la && echo list top level dir"
4140
docker exec slurm bash -c "ls -la /pydra && echo list pydra dir"
42-
if [[ "${{ matrix.python-version }}" == "3.11.5" ]]; then
43-
docker exec slurm bash -c "CONFIGURE_OPTS=\"-with-openssl=/opt/openssl\" pyenv install -v 3.11.5"
44-
fi
45-
docker exec slurm bash -c "pyenv global ${{ matrix.python-version }}"
46-
docker exec slurm bash -c "pip install --upgrade pip && pip install -e /pydra[test] && python -c 'import pydra; print(pydra.__version__)'"
41+
docker exec slurm bash -c "pip3.9 install --upgrade pip && pip3.9 install -e /pydra[test] && python3.9 -c 'import pydra; print(pydra.__version__)'"
4742
- name: Run pytest
4843
run: |
49-
docker exec slurm bash -c "pytest --color=yes -vs --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'"
44+
docker exec slurm bash -c "pytest --color=yes -vs -n auto --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'"
5045
- name: Upload to codecov
5146
run: |
52-
docker exec slurm bash -c "pip install urllib3==1.26.6"
47+
docker exec slurm bash -c "pip3.9 install urllib3==1.26.6"
5348
docker exec slurm bash -c "codecov --root /pydra -f /pydra/cov.xml -F unittests"
5449
docker rm -f slurm

pydra/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def pytest_generate_tests(metafunc):
1414
if bool(shutil.which("sbatch")):
1515
Plugins = ["slurm"]
1616
else:
17-
Plugins = ["cf"]
17+
Plugins = ["psij-local"]
1818
try:
1919
if metafunc.config.getoption("dask"):
2020
Plugins.append("dask")
@@ -34,7 +34,7 @@ def pytest_generate_tests(metafunc):
3434
elif bool(shutil.which("sbatch")):
3535
Plugins = ["slurm"]
3636
else:
37-
Plugins = ["cf"]
37+
Plugins = ["psij-local"]
3838
metafunc.parametrize("plugin", Plugins)
3939

4040

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ classifiers = [
4848
dynamic = ["version"]
4949

5050
[project.optional-dependencies]
51+
psij = [
52+
"psij-python",
53+
]
5154
dask = [
5255
"dask",
5356
"distributed",

0 commit comments

Comments
 (0)