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

Handling invalid output object from engines #206

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

tom-tan
Copy link
Member

@tom-tan tom-tan commented Apr 13, 2024

This request fixes #205 by handling JSONDecodeError thrown from json.loads when parsing an output object.
I also added a test for it.

Note that I extend tests.util.run_with_mock_cwl_runner to accept an executor as an optional argument.

After merging this request, an example in #205 is fixed as follows:

$ cwltest --tool tests/test-data/dummy-executor.sh --test tests/test-data/nothing.yml --junit-xml=result.xml
Test [1/2] do_nothing: Example of doing nothing
Test 1 failed: tests/test-data/dummy-executor.sh --outdir=/tmp/tmpsxaoak8e --quiet tests/test-data/true.cwl tests/test-data/empty.yml
Example of doing nothing
Output is not a valid JSON document: 'it is not JSON format!
'
Test [2/2] do_nothing2: Example of doing nothing more
Test 2 failed: tests/test-data/dummy-executor.sh --outdir=/tmp/tmpzsql2f61 --quiet tests/test-data/true.cwl tests/test-data/empty.yml
Example of doing nothing more
Output is not a valid JSON document: 'it is not JSON format!
'
0 tests passed, 2 failures, 0 unsupported features
$ ls result.xml 
result.xml

Copy link
Member

@mr-c mr-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @tom-tan !

@mr-c mr-c enabled auto-merge (rebase) April 25, 2024 11:02
@mr-c mr-c disabled auto-merge April 25, 2024 11:12
@mr-c mr-c merged commit 7266ad4 into common-workflow-language:main Apr 25, 2024
22 of 27 checks passed
@mr-c
Copy link
Member

mr-c commented Apr 25, 2024

Thanks again @tom-tan ; next time can you create your branch here, and not on your personal fork? We are having issues with codecov.io and PRs made from forks :-(

@tom-tan tom-tan deleted the fix-issue205 branch May 12, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An invalid output object from the engine causes an exception internally
2 participants