diff --git a/CHANGELOG.md b/CHANGELOG.md index 75fa1ffe..44880cb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Release History -## 2.2.4 (2019-07-13) +## 2.2.5 (2019-07-28) + +**Fixed** + +- fix #658: sys.exit 1 if any testcase failed + +## 2.2.4 (2019-07-18) **Changed** diff --git a/httprunner/cli.py b/httprunner/cli.py index 0e65ea4a..02cb4c13 100644 --- a/httprunner/cli.py +++ b/httprunner/cli.py @@ -3,6 +3,7 @@ def main_hrun(): """ API test: parse command line options and run commands. """ + import sys import argparse from httprunner import logger from httprunner import __description__, __version__ @@ -85,7 +86,10 @@ def main_hrun(): logger.log_error("!!!!!!!!!! exception stage: {} !!!!!!!!!!".format(runner.exception_stage)) raise - return 0 + if runner.summary and runner.summary["success"]: + sys.exit(0) + else: + sys.exit(1) def main_locust():