Skip to content

Commit 5e5615b

Browse files
committed
silence spurious warning when validating some documents with "cwltool" extensions
1 parent 222b53c commit 5e5615b

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

cwltool/extensions-v1.1.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
$base: http://commonwl.org/cwltool#
22
$namespaces:
33
cwl: "https://w3id.org/cwl/cwl#"
4+
cwltool: "http://commonwl.org/cwltool#"
45
$graph:
56
- $import: https://w3id.org/cwl/CommonWorkflowLanguage.yml
67

cwltool/extensions-v1.2.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
$base: http://commonwl.org/cwltool#
22
$namespaces:
33
cwl: "https://w3id.org/cwl/cwl#"
4+
cwltool: "http://commonwl.org/cwltool#"
45
$graph:
56
- $import: https://w3id.org/cwl/CommonWorkflowLanguage.yml
67

cwltool/loghandler.py

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def configure_logging(
2323
rdflib_logger.setLevel(logging.ERROR)
2424
deps_logger = logging.getLogger("galaxy.tool_util.deps")
2525
deps_logger.addHandler(stderr_handler)
26+
ss_logger = logging.getLogger("salad")
27+
ss_logger.addHandler(stderr_handler)
2628
if quiet:
2729
# Silence STDERR, not an eventual provenance log file
2830
stderr_handler.setLevel(logging.WARN)

tests/test_ext.py

+17-10
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
import cwltool.process
99
from cwltool.main import main
1010

11-
from .util import get_data, needs_docker
11+
from .util import get_data, get_main_output, needs_docker
1212

1313

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

1922

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

6972

70-
@pytest.mark.skip(reason="This is not the default behaviour yet")
71-
@needs_docker
72-
def test_listing_v1_1() -> None:
73-
# Default behavior in 1.1 will be no expansion
74-
assert main([get_data("tests/wf/listing_v1_1.cwl"), get_data("tests/listing-job.yml")]) != 0
75-
76-
7773
@needs_docker
7874
def test_double_overwrite(tmp_path: Path) -> None:
7975
"""Test that overwriting an input using cwltool:InplaceUpdateRequirement works."""
@@ -278,3 +274,14 @@ def test_warn_large_inputs() -> None:
278274
)
279275
finally:
280276
cwltool.process.FILE_COUNT_WARNING = was
277+
278+
279+
def test_ext_validation_no_namespace_warning() -> None:
280+
error_code, stdout, stderr = get_main_output(
281+
["--validate", "--enable-ext", get_data("tests/wf/mpi_env.cwl")]
282+
)
283+
assert error_code == 0
284+
assert (
285+
"URI prefix 'cwltool' of 'cwltool:loop' not recognized, are you "
286+
"missing a $namespaces section?"
287+
) not in stderr

0 commit comments

Comments
 (0)