Skip to content

Commit 6e10ec6

Browse files
committed
improve test running on mac-os
1 parent e45b3c1 commit 6e10ec6

17 files changed

+32
-27
lines changed

cwltool/argparser.py

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import urllib
66
from typing import (
77
Any,
8-
AnyStr,
98
Callable,
109
Dict,
1110
List,
@@ -18,8 +17,6 @@
1817
cast,
1918
)
2019

21-
from schema_salad.ref_resolver import file_uri
22-
2320
from .loghandler import _logger
2421
from .process import Process, shortname
2522
from .resolver import ga4gh_tool_registries

cwltool/command_line_tool.py

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from functools import cmp_to_key, partial
1616
from typing import (
1717
Any,
18-
Callable,
1918
Dict,
2019
Generator,
2120
List,

cwltool/cuda.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import subprocess # nosec
22
import xml.dom.minidom # nosec
3-
from typing import Tuple, cast
3+
from typing import Tuple
44

55
from .loghandler import _logger
66
from .utils import CWLObjectType

cwltool/docker.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from .builder import Builder
1818
from .context import RuntimeContext
19-
from .cuda import cuda_check
2019
from .docker_id import docker_vm_id
2120
from .errors import WorkflowException
2221
from .job import ContainerCommandLineJob

cwltool/provenance_profile.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@
2020
)
2121

2222
from prov.identifier import Identifier, QualifiedName
23-
from prov.model import (
24-
PROV,
25-
PROV_LABEL,
26-
PROV_TYPE,
27-
PROV_VALUE,
28-
ProvDocument,
29-
ProvEntity,
30-
ProvRecord,
31-
)
23+
from prov.model import PROV, PROV_LABEL, PROV_TYPE, PROV_VALUE, ProvDocument, ProvEntity
3224
from schema_salad.sourceline import SourceLine
3325
from typing_extensions import TYPE_CHECKING
3426

tests/checker_wf/wc.cwl

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env cwl-runner
22
cwlVersion: v1.1
33
class: CommandLineTool
4+
hints:
5+
DockerRequirement:
6+
dockerPull: docker.io/debian:stable-slim
47
inputs:
58
intxt:
69
type: File

tests/subgraph/count-lines17-wf.cwl.json

+5
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@
113113
"-l"
114114
],
115115
"class": "CommandLineTool",
116+
"hints": {
117+
"DockerRequirement": {
118+
"dockerPull": "docker.io/debian:stable-slim"
119+
}
120+
},
116121
"id": "count-lines17-wf.cwl@step_step1@run@step_stepX@run@step_stepY@run",
117122
"inputs": [
118123
{

tests/subgraph/wc-tool.cwl

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
class: CommandLineTool
44
cwlVersion: v1.0
55

6+
hints:
7+
DockerRequirement:
8+
dockerPull: docker.io/debian:stable-slim
9+
610
inputs:
711
file1: File
812

tests/test_cuda.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
from cwltool.job import CommandLineJob
1212
from cwltool.load_tool import load_tool
1313
from cwltool.main import main
14-
from cwltool.pathmapper import MapperEnt, PathMapper
15-
from cwltool.process import use_custom_schema, use_standard_schema
14+
from cwltool.pathmapper import PathMapper
15+
from cwltool.process import use_custom_schema
1616
from cwltool.stdfsaccess import StdFsAccess
17-
from cwltool.update import INTERNAL_VERSION, ORIGINAL_CWLVERSION
17+
from cwltool.update import INTERNAL_VERSION
1818
from cwltool.utils import CWLObjectType
1919

2020
from .util import get_data, needs_docker, needs_singularity_3_or_newer

tests/test_examples.py

+2
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ def test_static_checker() -> None:
910910
factory.make(get_data("tests/checker_wf/broken-wf3.cwl"))
911911

912912

913+
@needs_docker
913914
def test_circular_dependency_checker() -> None:
914915
# check that the circular dependency checker raises exception when there is
915916
# circular dependency in the workflow.
@@ -1449,6 +1450,7 @@ def test_no_compute_chcksum(tmp_path: Path, factor: str) -> None:
14491450
assert "checksum" not in stdout
14501451

14511452

1453+
@needs_docker
14521454
@pytest.mark.parametrize("factor", test_factors)
14531455
def test_bad_userspace_runtime(factor: str) -> None:
14541456
test_file = "tests/wf/wc-tool.cwl"

tests/test_misc_cli.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from cwltool.utils import versionstring
44

5-
from .util import get_data, get_main_output
5+
from .util import get_data, get_main_output, needs_docker
66

77

88
def test_version() -> None:
@@ -44,6 +44,7 @@ def test_basic_pack() -> None:
4444
assert "$graph" in stdout
4545

4646

47+
@needs_docker
4748
def test_basic_print_subgraph() -> None:
4849
"""Basic test of --print-subgraph. See test_subgraph.py for detailed testing."""
4950
return_code, stdout, stderr = get_main_output(

tests/test_parallel.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
from cwltool.executors import MultithreadedJobExecutor
66
from cwltool.factory import Factory
77

8-
from .util import get_data
8+
from .util import get_data, needs_docker
99

1010

11+
@needs_docker
1112
def test_sequential_workflow(tmp_path: Path) -> None:
1213
test_file = "tests/wf/count-lines1-wf.cwl"
1314
executor = MultithreadedJobExecutor()
@@ -20,6 +21,7 @@ def test_sequential_workflow(tmp_path: Path) -> None:
2021
assert echo(file1=file_contents) == {"count_output": 16}
2122

2223

24+
@needs_docker
2325
def test_scattered_workflow() -> None:
2426
test_file = "tests/wf/scatter-wf4.cwl"
2527
job_file = "tests/wf/scatter-job2.json"

tests/test_stdout_stderr_log_dir.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import json
2-
import os
32
from pathlib import Path
43

5-
from cwltool.main import main
6-
7-
from .util import get_data, get_main_output, needs_docker
4+
from .util import get_data, get_main_output
85

96

107
def test_log_dir_echo_output(tmp_path: Path) -> None:

tests/test_subgraph.py

+2
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def test_single_process_packed_subwf_step(tmp_path: Path) -> None:
240240
)
241241

242242

243+
@needs_docker
243244
def test_single_process_subwf_subwf_inline_step() -> None:
244245
"""Test --single-process on an inline sub-sub-workflow step."""
245246
err_code, stdout, stderr = get_main_output(
@@ -350,6 +351,7 @@ def test_print_targets_embedded_reqsinherit() -> None:
350351
assert err_code == 0
351352

352353

354+
@needs_docker
353355
def test_print_targets_embedded_sub_subwfs() -> None:
354356
"""Confirm that --print-targets works with inline sub-sub-workflows."""
355357
err_code, stdout, stderr = get_main_output(

tests/test_toolargparse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import argparse
22
from io import StringIO
33
from pathlib import Path
4-
from typing import Any, Callable, Dict, List
4+
from typing import Callable, List
55

66
import pytest
77

tests/test_udocker.py

-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def test_udocker_usage_should_not_write_cid_file(udocker: str, tmp_path: Path) -
5555
error_code, stdout, stderr = get_main_output(
5656
[
5757
"--debug",
58-
"--default-container",
59-
"debian",
6058
"--user-space-docker-cmd=" + udocker,
6159
get_data(test_file),
6260
get_data(job_file),

tests/wf/wc-tool.cwl

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
class: CommandLineTool
44
cwlVersion: v1.0
55

6+
hints:
7+
DockerRequirement:
8+
dockerPull: docker.io/debian:stable-slim
9+
610
inputs:
711
file1: File
812

0 commit comments

Comments
 (0)