Skip to content

Commit 354229a

Browse files
committed
Detect nextflow version when testing custom version
1 parent 3b635c3 commit 354229a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tests/integration/test_poll.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,13 @@ def runner(command):
202202

203203

204204
def test_can_run_with_specific_version(self):
205-
# Run basic execution
205+
nf_version = subprocess.check_output(["nextflow", "-v"]).decode("utf-8").strip().split()[-1]
206+
specific_version = "25.04.0" if nf_version.startswith("25") else "22.10.8"
206207
executions = []
207208
os.chdir(self.rundirectory)
208209
for execution in nextflow.run_and_poll(
209210
pipeline_path=self.get_path("pipeline.nf"),
210-
version="25.04.0",
211+
version=specific_version,
211212
params={
212213
"input": self.get_path("files/data.txt"), "count": "12",
213214
"suffix": self.get_path("files/suffix.txt")
@@ -216,7 +217,7 @@ def test_can_run_with_specific_version(self):
216217
executions.append(copy.deepcopy(execution))
217218

218219
# Execution is fine
219-
self.check_execution(execution, version="25.04.0", check_stderr=False)
220+
self.check_execution(execution, version=specific_version, check_stderr=False)
220221

221222
# Check that we have at least 2 executions
222223
self.assertGreater(len(executions), 1)

tests/integration/test_run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,19 +304,20 @@ def glob(self, path):
304304

305305

306306
def test_can_run_with_specific_version(self):
307-
# Run basic execution
307+
nf_version = subprocess.check_output(["nextflow", "-v"]).decode("utf-8").strip().split()[-1]
308+
specific_version = "25.04.0" if nf_version.startswith("25") else "22.10.8"
308309
os.chdir(self.rundirectory)
309310
execution = nextflow.run(
310311
pipeline_path=self.get_path("pipeline.nf"),
311-
version="25.04.0",
312+
version=specific_version,
312313
params={
313314
"input": self.get_path("files/data.txt"), "count": "12",
314315
"suffix": self.get_path("files/suffix.txt")
315316
}
316317
)
317318

318319
# Execution is fine
319-
self.check_execution(execution, version="25.04.0", check_stderr=False)
320+
self.check_execution(execution, version=specific_version, check_stderr=False)
320321

321322

322323
def test_can_run_with_specific_config(self):

0 commit comments

Comments
 (0)