Skip to content

Commit

Permalink
silence spurious warning when validating some documents with "cwltool…
Browse files Browse the repository at this point in the history
…" extensions
  • Loading branch information
mr-c committed Oct 13, 2023
1 parent 222b53c commit 953553a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions cwltool/extensions-v1.1.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$base: http://commonwl.org/cwltool#
$namespaces:
cwl: "https://w3id.org/cwl/cwl#"
cwltool: "http://commonwl.org/cwltool#"
$graph:
- $import: https://w3id.org/cwl/CommonWorkflowLanguage.yml

Expand Down
1 change: 1 addition & 0 deletions cwltool/extensions-v1.2.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$base: http://commonwl.org/cwltool#
$namespaces:
cwl: "https://w3id.org/cwl/cwl#"
cwltool: "http://commonwl.org/cwltool#"
$graph:
- $import: https://w3id.org/cwl/CommonWorkflowLanguage.yml

Expand Down
2 changes: 2 additions & 0 deletions cwltool/loghandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def configure_logging(
rdflib_logger.setLevel(logging.ERROR)
deps_logger = logging.getLogger("galaxy.tool_util.deps")
deps_logger.addHandler(stderr_handler)
ss_logger = logging.getLogger("salad")
ss_logger.addHandler(stderr_handler)
if quiet:
# Silence STDERR, not an eventual provenance log file
stderr_handler.setLevel(logging.WARN)
Expand Down
27 changes: 17 additions & 10 deletions tests/test_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
import cwltool.process
from cwltool.main import main

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


@needs_docker
def test_missing_enable_ext() -> None:
# Require that --enable-ext is provided.
assert main([get_data("tests/wf/listing_deep.cwl"), get_data("tests/listing-job.yml")]) != 0
"""Require that --enable-ext is provided."""
error_code, _, _ = get_main_output(
[get_data("tests/wf/listing_deep.cwl"), get_data("tests/listing-job.yml")]
)
assert error_code != 0


@needs_docker
Expand Down Expand Up @@ -67,13 +70,6 @@ def test_listing_v1_0() -> None:
assert main([get_data("tests/wf/listing_v1_0.cwl"), get_data("tests/listing-job.yml")]) == 0


@pytest.mark.skip(reason="This is not the default behaviour yet")
@needs_docker
def test_listing_v1_1() -> None:
# Default behavior in 1.1 will be no expansion
assert main([get_data("tests/wf/listing_v1_1.cwl"), get_data("tests/listing-job.yml")]) != 0


@needs_docker
def test_double_overwrite(tmp_path: Path) -> None:
"""Test that overwriting an input using cwltool:InplaceUpdateRequirement works."""
Expand Down Expand Up @@ -278,3 +274,14 @@ def test_warn_large_inputs() -> None:
)
finally:
cwltool.process.FILE_COUNT_WARNING = was


def test_ext_validation_no_namespace_warning() -> None:
error_code, stdout, stderr = get_main_output(
["--validate", "--enable-ext", get_data("tests/wf/mpi_env.cwl")]
)
assert error_code == 0
assert (
"URI prefix 'cwltool' of 'cwltool:loop' not recognized, are you "
"missing a $namespaces section?"
) not in stderr

0 comments on commit 953553a

Please sign in to comment.