Skip to content

Commit 584e15c

Browse files
authored
Running full pipelines in parallel in tests (#600)
* trying parallel tests1 * trying parallel tests2 * trying parallel tests3 * trying parallel tests4 * trying parallel tests5 * trying parallel tests6 * trying parallel tests7 * trying parallel tests8 * trying parallel tests9 * trying parallel tests10 * trying parallel tests11 * working parallel mpi tests * adding lprec parallel test * indisk test modification * revert the change * tests correction * adding new parallel tests * reformatting and removing the stalling test * removes the failing test from parallel tests
1 parent 8ccf663 commit 584e15c

3 files changed

Lines changed: 469 additions & 310 deletions

File tree

tests/conftest.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def pytest_configure(config):
3030
config.addinivalue_line(
3131
"markers", "full_data: mark tests to run full pipelines on raw big data"
3232
)
33+
config.addinivalue_line(
34+
"markers",
35+
"full_data_parallel: mark tests to run full pipelines on raw big data in parallel",
36+
)
3337
config.addinivalue_line(
3438
"markers", "preview: mark test to run with `httomo preview`"
3539
)
@@ -54,6 +58,12 @@ def pytest_addoption(parser):
5458
default=False,
5559
help="run full pipelines on raw (big) data",
5660
)
61+
parser.addoption(
62+
"--full_data_parallel",
63+
action="store_true",
64+
default=False,
65+
help="run full pipelines on raw (big) data in parallel on two processes",
66+
)
5767

5868

5969
def pytest_collection_modifyitems(config, items):
@@ -93,6 +103,20 @@ def pytest_collection_modifyitems(config, items):
93103
for item in items:
94104
if "full_data" in item.keywords:
95105
item.add_marker(skip_perf)
106+
if config.getoption("--full_data_parallel"):
107+
skip_other = pytest.mark.skip(
108+
reason="not a pipeline raw big data test in parallel"
109+
)
110+
for item in items:
111+
if "full_data_parallel" not in item.keywords:
112+
item.add_marker(skip_other)
113+
else:
114+
skip_perf = pytest.mark.skip(
115+
reason="pipeline raw big data test in parallel - use '--full_data_parallel' to run"
116+
)
117+
for item in items:
118+
if "full_data_parallel" in item.keywords:
119+
item.add_marker(skip_perf)
96120

97121

98122
@pytest.fixture
@@ -113,6 +137,19 @@ def cmd():
113137
]
114138

115139

140+
@pytest.fixture
141+
def cmd_mpirun():
142+
return [
143+
"mpirun",
144+
"-n",
145+
"2",
146+
str(sys.executable),
147+
"-m",
148+
"httomo",
149+
"run",
150+
]
151+
152+
116153
@pytest.fixture
117154
def standard_data():
118155
return "tests/test_data/tomo_standard.nxs"

0 commit comments

Comments
 (0)