Skip to content

Commit

Permalink
improve test running on mac-os
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c committed Aug 17, 2022
1 parent 3c3aee3 commit 2df4452
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 27 deletions.
3 changes: 0 additions & 3 deletions cwltool/argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import urllib
from typing import (
Any,
AnyStr,
Callable,
Dict,
List,
Expand All @@ -18,8 +17,6 @@
cast,
)

from schema_salad.ref_resolver import file_uri

from .loghandler import _logger
from .process import Process, shortname
from .resolver import ga4gh_tool_registries
Expand Down
1 change: 0 additions & 1 deletion cwltool/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from functools import cmp_to_key, partial
from typing import (
Any,
Callable,
Dict,
Generator,
List,
Expand Down
2 changes: 1 addition & 1 deletion cwltool/cuda.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import subprocess # nosec
import xml.dom.minidom # nosec
from typing import Tuple, cast
from typing import Tuple

from .loghandler import _logger
from .utils import CWLObjectType
Expand Down
1 change: 0 additions & 1 deletion cwltool/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from .builder import Builder
from .context import RuntimeContext
from .cuda import cuda_check
from .docker_id import docker_vm_id
from .errors import WorkflowException
from .job import ContainerCommandLineJob
Expand Down
10 changes: 1 addition & 9 deletions cwltool/provenance_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@
)

from prov.identifier import Identifier, QualifiedName
from prov.model import (
PROV,
PROV_LABEL,
PROV_TYPE,
PROV_VALUE,
ProvDocument,
ProvEntity,
ProvRecord,
)
from prov.model import PROV, PROV_LABEL, PROV_TYPE, PROV_VALUE, ProvDocument, ProvEntity
from schema_salad.sourceline import SourceLine
from typing_extensions import TYPE_CHECKING

Expand Down
3 changes: 3 additions & 0 deletions tests/checker_wf/wc.cwl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.1
class: CommandLineTool
hints:
DockerRequirement:
dockerPull: docker.io/debian:stable-slim
inputs:
intxt:
type: File
Expand Down
5 changes: 5 additions & 0 deletions tests/subgraph/count-lines17-wf.cwl.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@
"-l"
],
"class": "CommandLineTool",
"hints": {
"DockerRequirement": {
"dockerPull": "docker.io/debian:stable-slim"
}
},
"id": "count-lines17-wf.cwl@step_step1@run@step_stepX@run@step_stepY@run",
"inputs": [
{
Expand Down
4 changes: 4 additions & 0 deletions tests/subgraph/wc-tool.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
class: CommandLineTool
cwlVersion: v1.0

hints:
DockerRequirement:
dockerPull: docker.io/debian:stable-slim

inputs:
file1: File

Expand Down
6 changes: 3 additions & 3 deletions tests/test_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from cwltool.job import CommandLineJob
from cwltool.load_tool import load_tool
from cwltool.main import main
from cwltool.pathmapper import MapperEnt, PathMapper
from cwltool.process import use_custom_schema, use_standard_schema
from cwltool.pathmapper import PathMapper
from cwltool.process import use_custom_schema
from cwltool.stdfsaccess import StdFsAccess
from cwltool.update import INTERNAL_VERSION, ORIGINAL_CWLVERSION
from cwltool.update import INTERNAL_VERSION
from cwltool.utils import CWLObjectType

from .util import get_data, needs_docker, needs_singularity_3_or_newer
Expand Down
2 changes: 2 additions & 0 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ def test_static_checker() -> None:
factory.make(get_data("tests/checker_wf/broken-wf3.cwl"))


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


@needs_docker
@pytest.mark.parametrize("factor", test_factors)
def test_bad_userspace_runtime(factor: str) -> None:
test_file = "tests/wf/wc-tool.cwl"
Expand Down
3 changes: 2 additions & 1 deletion tests/test_misc_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from cwltool.utils import versionstring

from .util import get_data, get_main_output
from .util import get_data, get_main_output, needs_docker


def test_version() -> None:
Expand Down Expand Up @@ -44,6 +44,7 @@ def test_basic_pack() -> None:
assert "$graph" in stdout


@needs_docker
def test_basic_print_subgraph() -> None:
"""Basic test of --print-subgraph. See test_subgraph.py for detailed testing."""
return_code, stdout, stderr = get_main_output(
Expand Down
4 changes: 3 additions & 1 deletion tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from cwltool.executors import MultithreadedJobExecutor
from cwltool.factory import Factory

from .util import get_data
from .util import get_data, needs_docker


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


@needs_docker
def test_scattered_workflow() -> None:
test_file = "tests/wf/scatter-wf4.cwl"
job_file = "tests/wf/scatter-job2.json"
Expand Down
5 changes: 1 addition & 4 deletions tests/test_stdout_stderr_log_dir.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import json
import os
from pathlib import Path

from cwltool.main import main

from .util import get_data, get_main_output, needs_docker
from .util import get_data, get_main_output


def test_log_dir_echo_output(tmp_path: Path) -> None:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_subgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def test_single_process_packed_subwf_step(tmp_path: Path) -> None:
)


@needs_docker
def test_single_process_subwf_subwf_inline_step() -> None:
"""Test --single-process on an inline sub-sub-workflow step."""
err_code, stdout, stderr = get_main_output(
Expand Down Expand Up @@ -350,6 +351,7 @@ def test_print_targets_embedded_reqsinherit() -> None:
assert err_code == 0


@needs_docker
def test_print_targets_embedded_sub_subwfs() -> None:
"""Confirm that --print-targets works with inline sub-sub-workflows."""
err_code, stdout, stderr = get_main_output(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_toolargparse.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
from io import StringIO
from pathlib import Path
from typing import Any, Callable, Dict, List
from typing import Callable, List

import pytest

Expand Down
2 changes: 0 additions & 2 deletions tests/test_udocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ def test_udocker_usage_should_not_write_cid_file(udocker: str, tmp_path: Path) -
error_code, stdout, stderr = get_main_output(
[
"--debug",
"--default-container",
"debian",
"--user-space-docker-cmd=" + udocker,
get_data(test_file),
get_data(job_file),
Expand Down
4 changes: 4 additions & 0 deletions tests/wf/wc-tool.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
class: CommandLineTool
cwlVersion: v1.0

hints:
DockerRequirement:
dockerPull: docker.io/debian:stable-slim

inputs:
file1: File

Expand Down

0 comments on commit 2df4452

Please sign in to comment.