Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silence spurious warning when validating some documents with "cwltool" extensions #1921

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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