Skip to content

Add known failure testing capability #38

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

Merged
merged 3 commits into from
Dec 20, 2017
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ matrix:
python: 2.7

install:
- pip install tox-travis
- pip2 install tox-travis || pip3 install tox-travis
script: tox
notifications:
email: false
Expand Down
8 changes: 8 additions & 0 deletions cwltest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def run_test(args, i, tests): # type: (argparse.Namespace, int, List[Dict[str,
except subprocess.CalledProcessError as err:
if err.returncode == UNSUPPORTED_FEATURE:
return TestResult(UNSUPPORTED_FEATURE, outstr, outerr, duration, args.classname)
elif t.get("should_fail", False):
return TestResult(0, outstr, outerr, duration, args.classname)
else:
_logger.error(u"""Test failed: %s""", " ".join([pipes.quote(tc) for tc in test_command]))
_logger.error(t.get("doc"))
Expand All @@ -237,6 +239,12 @@ def run_test(args, i, tests): # type: (argparse.Namespace, int, List[Dict[str,

fail_message = ''

if t.get("should_fail", False):
_logger.warn(u"""Test failed: %s""", " ".join([pipes.quote(tc) for tc in test_command]))
_logger.warn(t.get("doc"))
_logger.warn(u"Returned zero but it should be non-zero")
return TestResult(1, outstr, outerr, duration, args.classname)

try:
compare(t.get("output"), out)
except CompareFail as ex:
Expand Down