Skip to content

Commit

Permalink
Improve mark name, duplicate test cmds into Make
Browse files Browse the repository at this point in the history
  • Loading branch information
asoplata committed Nov 8, 2024
1 parent 7afbe60 commit 02e4391
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/unix_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
shell: bash -el {0}
run: |
flake8 --count hnn_core
- name: Test embarrassingly parallel tests with pytest
- name: Test non-MPI, embarrassingly parallel tests with pytest
shell: bash -el {0}
run: |
python -m pytest ./hnn_core/tests/ -m "not already_parallel" -n auto --cov=hnn_core --cov-report=xml
- name: Test true parallel tests with pytest
python -m pytest ./hnn_core/tests/ -m "not uses_mpi" -n auto --cov=hnn_core --cov-report=xml
- name: Test MPI-using parallel tests with pytest
shell: bash -el {0}
run: |
python -m pytest ./hnn_core/tests/ -m "already_parallel" --cov=hnn_core --cov-report=xml --cov-append
python -m pytest ./hnn_core/tests/ -m "uses_mpi" --cov=hnn_core --cov-report=xml --cov-append
- name: Upload coverage to Codecov
shell: bash -el {0}
run: |
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ check-manifest:
check-manifest

test: flake
pytest .
pytest ./hnn_core/tests/ -m "not uses_mpi" -n auto
pytest ./hnn_core/tests/ -m "uses_mpi"

flake:
@if command -v flake8 > /dev/null; then \
Expand Down
2 changes: 1 addition & 1 deletion hnn_core/tests/test_dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def test_dipole_simulation():

@requires_mpi4py
@requires_psutil
@pytest.mark.already_parallel
@pytest.mark.uses_mpi
def test_cell_response_backends(run_hnn_core_fixture):
"""Test cell_response outputs across backends."""

Expand Down
2 changes: 1 addition & 1 deletion hnn_core/tests/test_extracellular.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_transfer_resistance():

@requires_mpi4py
@requires_psutil
@pytest.mark.already_parallel
@pytest.mark.uses_mpi
def test_extracellular_backends(run_hnn_core_fixture):
"""Test extracellular outputs across backends."""
# calculation of CSD requires >=4 electrode contacts
Expand Down
2 changes: 1 addition & 1 deletion hnn_core/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def test_gui_init_network(setup_gui):

@requires_mpi4py
@requires_psutil
@pytest.mark.already_parallel
@pytest.mark.uses_mpi
def test_gui_run_simulation_mpi():
"""Test if run button triggers simulation with MPIBackend."""
gui = HNNGUI()
Expand Down
4 changes: 2 additions & 2 deletions hnn_core/tests/test_parallel_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_gid_assignment():


@pytest.mark.incremental
@pytest.mark.already_parallel
@pytest.mark.uses_mpi
class TestParallelBackends():
dpls_reduced_mpi = None
dpls_reduced_default = None
Expand Down Expand Up @@ -242,7 +242,7 @@ def test_compare_hnn_core(self, run_hnn_core_fixture, backend, n_jobs=1):
# class marked incremental
@requires_mpi4py
@requires_psutil
@pytest.mark.already_parallel
@pytest.mark.uses_mpi
def test_mpi_failure(run_hnn_core_fixture):
"""Test that an MPI failure is handled and messages are printed"""
# this MPI parameter will cause a MPI job to fail
Expand Down

0 comments on commit 02e4391

Please sign in to comment.