|
17 | 17 | shutil.which("singularity") is None, reason="no singularity available"
|
18 | 18 | )
|
19 | 19 |
|
| 20 | +need_slurm = pytest.mark.skipif( |
| 21 | + not bool(shutil.which("sbatch")), reason="no singularity available" |
| 22 | +) |
| 23 | + |
20 | 24 |
|
21 | 25 | @need_singularity
|
22 | 26 | def test_singularity_1_nosubm(tmpdir):
|
@@ -255,6 +259,26 @@ def test_singularity_st_3(plugin, tmpdir):
|
255 | 259 | assert "Ubuntu" in res[3].output.stdout
|
256 | 260 |
|
257 | 261 |
|
| 262 | +@need_singularity |
| 263 | +@need_slurm |
| 264 | +@pytest.mark.xfail( |
| 265 | + reason="slurm can complain if the number of submitted jobs exceeds the limit" |
| 266 | +) |
| 267 | +@pytest.mark.parametrize("n", [10, 50, 100]) |
| 268 | +def test_singularity_st_4(tmpdir, n): |
| 269 | + """ splitter over args (checking bigger splitters if slurm available)""" |
| 270 | + args_n = list(range(n)) |
| 271 | + image = "library://sylabsed/linux/alpine" |
| 272 | + singu = SingularityTask( |
| 273 | + name="singu", executable="echo", image=image, cache_dir=tmpdir, args=args_n |
| 274 | + ).split("args") |
| 275 | + assert singu.state.splitter == "singu.args" |
| 276 | + res = singu(plugin="slurm") |
| 277 | + assert "1" in res[1].output.stdout |
| 278 | + assert str(n - 1) in res[-1].output.stdout |
| 279 | + assert res[0].output.return_code == res[1].output.return_code == 0 |
| 280 | + |
| 281 | + |
258 | 282 | @need_singularity
|
259 | 283 | def test_wf_singularity_1(plugin, tmpdir):
|
260 | 284 | """ a workflow with two connected task
|
|
0 commit comments