[med-svn] [Git][med-team/cwltest][upstream] New upstream version 2.5.20240425111257
Michael R. Crusoe (@crusoe)
gitlab at salsa.debian.org
Thu Apr 25 14:32:21 BST 2024
Michael R. Crusoe pushed to branch upstream at Debian Med / cwltest
Commits:
5e3d8410 by Michael R. Crusoe at 2024-04-25T16:17:40+03:00
New upstream version 2.5.20240425111257
- - - - -
15 changed files:
- PKG-INFO
- cwltest.egg-info/PKG-INFO
- cwltest.egg-info/SOURCES.txt
- cwltest/_version.py
- cwltest/main.py
- cwltest/utils.py
- dev-requirements.txt
- mypy-requirements.txt
- mypy.ini
- + tests/test-data/dummy-executor.sh
- + tests/test-data/empty.yml
- + tests/test-data/nothing.yml
- + tests/test-data/true.cwl
- + tests/test_invalid_outputs.py
- tests/util.py
Changes:
=====================================
PKG-INFO
=====================================
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: cwltest
-Version: 2.5.20240304113812
+Version: 2.5.20240425111257
Summary: Common Workflow Language testing framework
Author-email: Common workflow language working group <common-workflow-language at googlegroups.com>
License: Apache 2.0
=====================================
cwltest.egg-info/PKG-INFO
=====================================
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: cwltest
-Version: 2.5.20240304113812
+Version: 2.5.20240425111257
Summary: Common Workflow Language testing framework
Author-email: Common workflow language working group <common-workflow-language at googlegroups.com>
License: Apache 2.0
=====================================
cwltest.egg-info/SOURCES.txt
=====================================
@@ -95,6 +95,7 @@ tests/test_categories.py
tests/test_compare.py
tests/test_exclude_tags.py
tests/test_integer_id.py
+tests/test_invalid_outputs.py
tests/test_multi_lined_doc.py
tests/test_plugin.py
tests/test_prepare.py
@@ -106,10 +107,13 @@ tests/test-data/conformance_test_v1.0.cwltest.yml
tests/test-data/conformance_test_v1.2.cwltest.yaml
tests/test-data/cores.txt
tests/test-data/cwltool-conftest.py
+tests/test-data/dummy-executor.sh
+tests/test-data/empty.yml
tests/test-data/exclude-tags.yml
tests/test-data/integer-id.yml
tests/test-data/mock_cwl_runner.py
tests/test-data/multi-lined-doc.yml
+tests/test-data/nothing.yml
tests/test-data/optional-error.yml
tests/test-data/optional-unsupported.yml
tests/test-data/required-unsupported.yml
@@ -120,6 +124,7 @@ tests/test-data/short-names.yml
tests/test-data/string-id.yml
tests/test-data/timeout.cwl
tests/test-data/timeout.yml
+tests/test-data/true.cwl
tests/test-data/with-and-without-short-names.yml
tests/test-data/v1.0/args.py
tests/test-data/v1.0/cat-job.json
=====================================
cwltest/_version.py
=====================================
@@ -12,5 +12,5 @@ __version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
-__version__ = version = '2.5.20240304113812'
-__version_tuple__ = version_tuple = (2, 5, 20240304113812)
+__version__ = version = '2.5.20240425111257'
+__version_tuple__ = version_tuple = (2, 5, 20240425111257)
=====================================
cwltest/main.py
=====================================
@@ -132,7 +132,7 @@ def main() -> int:
for t in tests:
if t.get("label"):
logger.warning("The `label` field is deprecated. Use `id` field instead.")
- t["short_name"] = t["label"]
+ t["short_name"] = t["label"] # noqa: B909
elif t.get("id"):
if isinstance(t.get("id"), str):
t["short_name"] = utils.shortname(t["id"])
=====================================
cwltest/utils.py
=====================================
@@ -422,6 +422,23 @@ def run_test_plain(
" ".join([shlex.quote(tc) for tc in test_command]),
)
raise
+ except json.JSONDecodeError:
+ logger.error(
+ """Test %s failed: %s""",
+ number,
+ " ".join([shlex.quote(tc) for tc in test_command]),
+ )
+ logger.error(test.get("doc", "").replace("\n", " ").strip())
+ invalid_json_msg = "Output is not a valid JSON document: '%s'" % outstr
+ logger.error(invalid_json_msg)
+ return TestResult(
+ 1,
+ outstr,
+ outerr,
+ duration,
+ config.classname,
+ invalid_json_msg,
+ )
except subprocess.TimeoutExpired:
logger.error(
"""Test %s timed out: %s""",
=====================================
dev-requirements.txt
=====================================
@@ -1,5 +1,5 @@
diff_cover
-black ~= 24.2
+black ~= 24.4
pylint
pep257
pydocstyle
=====================================
mypy-requirements.txt
=====================================
@@ -1,4 +1,4 @@
-mypy==1.8.0
+mypy==1.10.0
types-setuptools
types-requests
types-PyYAML
=====================================
mypy.ini
=====================================
@@ -1,24 +1,10 @@
[mypy]
+strict = True
show_error_context = true
show_column_numbers = true
show_error_codes = true
pretty = true
-
-# --strict options as of mypy 0.910
-warn_unused_configs = True
-disallow_any_generics = True
-disallow_subclassing_any = True
-disallow_untyped_calls = True
-disallow_untyped_defs = True
-disallow_incomplete_defs = True
-check_untyped_defs = True
-disallow_untyped_decorators = True
-no_implicit_optional = True
-warn_redundant_casts = True
-warn_unused_ignores = True
-warn_return_any = True
-implicit_reexport = False
-strict_equality = True
+warn_unreachable = True
[mypy-ruamel.*]
ignore_errors = True
=====================================
tests/test-data/dummy-executor.sh
=====================================
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo "it is not JSON format!"
=====================================
tests/test-data/empty.yml
=====================================
@@ -0,0 +1 @@
+{}
=====================================
tests/test-data/nothing.yml
=====================================
@@ -0,0 +1,10 @@
+- job: empty.yml
+ tool: true.cwl
+ output: {}
+ id: do_nothing
+ doc: Example of doing nothing
+- job: empty.yml
+ tool: true.cwl
+ output: {}
+ id: do_nothing2
+ doc: Example of doing nothing more
=====================================
tests/test-data/true.cwl
=====================================
@@ -0,0 +1,5 @@
+class: CommandLineTool
+cwlVersion: v1.0
+inputs: {}
+outputs: {}
+baseCommand: ["true"]
=====================================
tests/test_invalid_outputs.py
=====================================
@@ -0,0 +1,17 @@
+from pathlib import Path
+
+import schema_salad.ref_resolver
+
+from .util import get_data, run_with_mock_cwl_runner
+
+
+def test_invalid_outputs(tmp_path: Path) -> None:
+ args = [
+ "--test",
+ schema_salad.ref_resolver.file_uri(get_data("tests/test-data/nothing.yml")),
+ ]
+ error_code, stdout, stderr = run_with_mock_cwl_runner(
+ args, get_data("tests/test-data/dummy-executor.sh")
+ )
+ assert error_code == 1
+ assert "0 tests passed, 2 failures, 0 unsupported features" in stderr
=====================================
tests/util.py
=====================================
@@ -5,7 +5,7 @@ import os
import subprocess # nosec
from contextlib import ExitStack
from pathlib import Path
-from typing import List, Tuple
+from typing import List, Optional, Tuple
from cwltest.utils import as_file, files
@@ -28,9 +28,12 @@ def get_data(filename: str) -> str:
return str(filepath.resolve())
-def run_with_mock_cwl_runner(args: List[str]) -> Tuple[int, str, str]:
+def run_with_mock_cwl_runner(
+ args: List[str], cwl_runner: Optional[str] = None
+) -> Tuple[int, str, str]:
"""Bind a mock cwlref-runner implementation to cwltest."""
- cwl_runner = get_data("tests/test-data/mock_cwl_runner.py")
+ if cwl_runner is None:
+ cwl_runner = get_data("tests/test-data/mock_cwl_runner.py")
process = subprocess.Popen( # nosec
["cwltest", "--tool", cwl_runner] + args,
stdout=subprocess.PIPE,
View it on GitLab: https://salsa.debian.org/med-team/cwltest/-/commit/5e3d8410a22f49fb812b34869fb0d53ac824c6c0
--
View it on GitLab: https://salsa.debian.org/med-team/cwltest/-/commit/5e3d8410a22f49fb812b34869fb0d53ac824c6c0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240425/99c0a4f7/attachment-0001.htm>
More information about the debian-med-commit
mailing list