Skip to content

Commit 4693cb9

Browse files
authored
Merge pull request #38 from tom-tan/known-failure-testing
Add known failure testing capability
2 parents e047c97 + e0cde1c commit 4693cb9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ matrix:
1212
python: 2.7
1313

1414
install:
15-
- pip install tox-travis
15+
- pip2 install tox-travis || pip3 install tox-travis
1616
script: tox
1717
notifications:
1818
email: false

cwltest/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ def run_test(args, i, tests): # type: (argparse.Namespace, int, List[Dict[str,
220220
except subprocess.CalledProcessError as err:
221221
if err.returncode == UNSUPPORTED_FEATURE:
222222
return TestResult(UNSUPPORTED_FEATURE, outstr, outerr, duration, args.classname)
223+
elif t.get("should_fail", False):
224+
return TestResult(0, outstr, outerr, duration, args.classname)
223225
else:
224226
_logger.error(u"""Test failed: %s""", " ".join([pipes.quote(tc) for tc in test_command]))
225227
_logger.error(t.get("doc"))
@@ -237,6 +239,12 @@ def run_test(args, i, tests): # type: (argparse.Namespace, int, List[Dict[str,
237239

238240
fail_message = ''
239241

242+
if t.get("should_fail", False):
243+
_logger.warn(u"""Test failed: %s""", " ".join([pipes.quote(tc) for tc in test_command]))
244+
_logger.warn(t.get("doc"))
245+
_logger.warn(u"Returned zero but it should be non-zero")
246+
return TestResult(1, outstr, outerr, duration, args.classname)
247+
240248
try:
241249
compare(t.get("output"), out)
242250
except CompareFail as ex:

0 commit comments

Comments
 (0)