Skip to content

Commit a265968

Browse files
committed
enable test_arguments_self on systems without docker
1 parent 2ca1a0d commit a265968

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_examples.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import stat
66
import subprocess
77
import sys
8+
import shutil
89
from io import StringIO
910
from pathlib import Path
1011
from typing import Any, Dict, List, Union, cast
@@ -1532,6 +1533,19 @@ def test_malformed_reqs() -> None:
15321533
def test_arguments_self() -> None:
15331534
"""Confirm that $(self) works in the arguments list."""
15341535
factory = cwltool.factory.Factory()
1536+
if not shutil.which("docker"):
1537+
if shutil.which("podman"):
1538+
factory.runtime_context.podman = True
1539+
factory.loading_context.podman = True
1540+
elif shutil.which("singularity"):
1541+
factory.runtime_context.singularity = True
1542+
factory.loading_context.singularity = True
1543+
elif not shutil.which("jq"):
1544+
pytest.skip(
1545+
"Need a container engine (docker, podman, or signularity) or jq to run this test."
1546+
)
1547+
else:
1548+
factory.runtime_context.use_container = False
15351549
check = factory.make(get_data("tests/wf/paramref_arguments_self.cwl"))
15361550
outputs = cast(Dict[str, Any], check())
15371551
assert "self_review" in outputs

0 commit comments

Comments
 (0)