|
4 | 4 |
|
5 | 5 | import pytest |
6 | 6 |
|
7 | | -from _test_tools import assert_completed, _get_executor_instance |
| 7 | +from _test_tools import assert_completed, _get_executor_instance, _deploy |
8 | 8 | from executor_test_params import ExecutorTestParams |
9 | 9 | from psij import Job, JobSpec, ResourceSpecV1 |
10 | 10 |
|
|
14 | 14 | def test_nodefile(execparams: ExecutorTestParams) -> None: |
15 | 15 | if execparams.executor in NOT_TESTED: |
16 | 16 | pytest.skip('This test does not work with %s' % execparams.executor) |
| 17 | + if execparams.launcher == 'single': |
| 18 | + pytest.skip('This test does not work with the single launcher') |
17 | 19 |
|
18 | 20 | my_path = os.path.dirname(os.path.realpath(__file__)) |
19 | 21 |
|
20 | 22 | N_PROC = 4 |
21 | 23 | with TemporaryDirectory(dir=Path.home() / '.psij' / 'test') as td: |
22 | 24 | outp = Path(td, 'stdout.txt') |
23 | | - spec = JobSpec('/bin/bash', [os.path.join(my_path, 'test_nodefile.sh'), str(N_PROC)], |
24 | | - stdout_path=outp) |
25 | | - job = Job(spec) |
26 | | - spec.resources = ResourceSpecV1(process_count=N_PROC) |
27 | | - ex = _get_executor_instance(execparams, job) |
28 | | - ex.submit(job) |
29 | | - status = job.wait() |
30 | | - assert_completed(job, status) |
| 25 | + with _deploy(os.path.join(my_path, 'test_nodefile.sh')) as excp: |
| 26 | + spec = JobSpec('/bin/bash', [str(excp), str(N_PROC)], |
| 27 | + stdout_path=outp) |
| 28 | + job = Job(spec) |
| 29 | + spec.resources = ResourceSpecV1(process_count=N_PROC) |
| 30 | + ex = _get_executor_instance(execparams, job) |
| 31 | + ex.submit(job) |
| 32 | + status = job.wait() |
| 33 | + assert_completed(job, status) |
0 commit comments