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

fix invalid literal data numerics conversion and validation between WPS/OAS/CWL representations #558

Merged
merged 13 commits into from
Sep 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
11 changes: 11 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ Fixes:
- Fix `Job` creation failing when submitting an empty string as input for a `Process` that allows it due
to schema validation incorrectly preventing it.
- Fix human-readable `JSON`-like content cleanup to preserve sequences of quotes corresponding to valid empty strings.
- Fix `WPS` I/O ``integer`` literal data conversion to `OpenAPI` I/O ``schema`` definition injecting an
invalid ``format: double`` property due to type checking with ``float`` succeeding against ``int`` values.
- Fix `CWL` I/O value validation for ``enum``-like definitions from corresponding `OpenAPI` and `WPS` I/O.
Since `CWL` I/O do not allow ``Enum`` type for values other than basic ``string`` type, ``valueFrom`` attribute is
used to handle ``int``, ``float`` and ``bool`` types, using an embedded JavaScript validation against allowed values.
Because of this validation strategy, `CWL` packages must now include ``InlineJavascriptRequirement`` when allowed
values for these basic types must be performed in order for the `CWL` engine to parse I/O contents of ``valueFrom``
(relates to `cwl-v1.2#267 <https://github.com/common-workflow-language/cwl-v1.2/issues/267>`_,
`common-workflow-language#764 <https://github.com/common-workflow-language/common-workflow-language/issues/764>`_ and
`common-workflow-language#907 <https://github.com/common-workflow-language/common-workflow-language/issues/907>`_).
- Fix typing definitions for certain ``Literal`` references for proper resolution involving values stored in constants.
- Fix ``get_sane_name`` checks performed on `Process` ID and `Service` name to use ``min_len=1`` in order to allow
valid `WPS` process definition on existing servers to resolve references that are shorter than the previous default
of 3 characters.
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ parameterized
pluggy>=0.7
# FIXME: bad interpolation of 'setup.cfg' for pytest 'log_format' (https://github.com/pytest-dev/pytest/issues/10019)
pytest<7
pytest-rerunfailures
pydocstyle
pylint>=2.11,!=2.12,<2.14; python_version <= "3.6"
pylint>=2.15.4; python_version >= "3.7"
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ def test_execute_inputs_invalid(self):
]:
self.run_execute_inputs_schema_variant(invalid_inputs_schema, expect_success=False)

@pytest.mark.flaky(reruns=2, reruns_delay=1)
def test_execute_manual_monitor_status_and_download_results(self):
"""
Test a typical case of :term:`Job` execution, result retrieval and download, but with manual monitoring.
Expand Down Expand Up @@ -813,6 +814,7 @@ def add_docker_pull_ref(cwl, ref):
cwl["requirements"][CWL_REQUIREMENT_APP_DOCKER] = {"dockerPull": ref}
return cwl

@pytest.mark.flaky(reruns=2, reruns_delay=1)
def test_deploy_docker_auth_username_password_valid(self):
"""
Test that username and password arguments can be provided simultaneously for docker login.
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_wps_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2315,6 +2315,7 @@ def test_execute_with_browsable_directory(self):
assert all(file.startswith(cwl_stage_dir) for file in output_listing)
assert all(any(file.endswith(dir_file) for file in output_listing) for dir_file in expect_http_files)

@pytest.mark.flaky(reruns=2, reruns_delay=1)
def test_execute_with_json_listing_directory(self):
"""
Test that HTTP returning JSON list of directory contents retrieves children files for the process.
Expand Down
Loading
Loading