diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c14f3efa..d5dd03b6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,7 @@ --- name: Bug report about: Create a report to help us improve -title: BUG +title: '' labels: Pending assignees: debugtalk --- diff --git a/.github/ISSUE_TEMPLATE/bug_report_zh.md b/.github/ISSUE_TEMPLATE/bug_report_zh.md index 7879cfc0..3cb953f2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_zh.md +++ b/.github/ISSUE_TEMPLATE/bug_report_zh.md @@ -1,7 +1,7 @@ --- name: Bug 反馈(中文) about: 提交 bug 反馈 -title: BUG +title: '' labels: Pending assignees: debugtalk --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 6d66475a..5adc1cfa 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,7 +1,7 @@ --- name: Feature request about: Suggest an idea for this project -title: FEATURE +title: '' labels: Pending assignees: debugtalk --- diff --git a/.github/ISSUE_TEMPLATE/feature_request_zh.md b/.github/ISSUE_TEMPLATE/feature_request_zh.md index 882c553d..32f3bc5f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request_zh.md +++ b/.github/ISSUE_TEMPLATE/feature_request_zh.md @@ -1,7 +1,7 @@ --- name: 需求反馈 about: 期望新增或改进实现的需求 -title: FEATURE +title: '' labels: Pending assignees: debugtalk --- diff --git a/README.md b/README.md index 4bdbb75c..0cfe8ca6 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,12 @@ Thank you to all our sponsors! ✨🍰✨ ([become a sponsor](docs/sponsors.md)) 霍格沃兹测试学院是 HttpRunner 的首家金牌赞助商。 +### 开源服务赞助商(Open Source Sponsor) + +[Sentry](https://sentry.io/_/open-source/) + +HttpRunner is in Sentry Sponsored plan. + ## How to Contribute 1. Check for [open issues](https://github.com/httprunner/httprunner/issues) or [open a fresh issue](https://github.com/httprunner/httprunner/issues/new/choose) to start a discussion around a feature idea or a bug. diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 2bfc6d4e..08363413 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 2.4.6 (2019-12-23) + +**Added** + +- feat: report tests start event and running exception to sentry + +**Fixed** + +- fix: ensure initializing sentry_sdk on startup + +**Fixed** + ## 2.4.5 (2019-12-20) **Added** diff --git a/docs/assets/sentry-logo-black.svg b/docs/assets/sentry-logo-black.svg new file mode 100644 index 00000000..59b79bc5 --- /dev/null +++ b/docs/assets/sentry-logo-black.svg @@ -0,0 +1 @@ +sentry-logo-black \ No newline at end of file diff --git a/docs/sponsors.md b/docs/sponsors.md index 40be9967..fdc764ad 100644 --- a/docs/sponsors.md +++ b/docs/sponsors.md @@ -10,9 +10,15 @@ 霍格沃兹测试学院是 HttpRunner 的首家金牌赞助商。 +### 开源服务赞助商(Open Source Sponsor) + +[Sentry](https://sentry.io/_/open-source/) + +HttpRunner is in Sentry Sponsored plan. + ## 成为赞助商 -如果你所在的公司或个人也想对 HttpRunner 进行赞助,可参考如下方案,具体可联系[项目作者](mailto:mail@debugtalk.com)。 +如果你所在的公司或个人也想对 HttpRunner 进行赞助,可参考如下方案,具体可联系[项目作者](mailto:debugtalk@gmail.com)。 | 等级 | 金牌赞助商
(Gold Sponsor) | 银牌赞助商
(Silver Sponsor)| 个人赞赏 | |:---:|:---:|:---:|:---:| diff --git a/httprunner/__init__.py b/httprunner/__init__.py index 798f1866..5beb3a6c 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -1,4 +1,11 @@ -__version__ = "2.4.5" +__version__ = "2.4.6" __description__ = "One-stop solution for HTTP(S) testing." __all__ = ["__version__", "__description__"] + +import sentry_sdk + +sentry_sdk.init( + dsn="https://cc6dd86fbe9f4e7fbd95248cfcff114d@sentry.io/1862849", + release="httprunner@{}".format(__version__) +) diff --git a/httprunner/__main__.py b/httprunner/__main__.py index 59d39cb5..70236a86 100644 --- a/httprunner/__main__.py +++ b/httprunner/__main__.py @@ -1,11 +1,6 @@ import sys - -import sentry_sdk - from httprunner.cli import main -sentry_sdk.init("https://cc6dd86fbe9f4e7fbd95248cfcff114d@sentry.io/1862849") - if __name__ == "__main__": sys.exit(main()) diff --git a/httprunner/api.py b/httprunner/api.py index 18ec9389..7e017213 100644 --- a/httprunner/api.py +++ b/httprunner/api.py @@ -1,6 +1,8 @@ import os import unittest +from sentry_sdk import capture_message + from httprunner import (__version__, exceptions, loader, logger, parser, report, runner, utils) @@ -183,6 +185,7 @@ class HttpRunner(object): def run_tests(self, tests_mapping): """ run testcase/testsuite data """ + capture_message("start to run tests") project_mapping = tests_mapping.get("project_mapping", {}) self.project_working_directory = project_mapping.get("PWD", os.getcwd()) diff --git a/httprunner/cli.py b/httprunner/cli.py index a2356591..dcabb184 100644 --- a/httprunner/cli.py +++ b/httprunner/cli.py @@ -1,7 +1,7 @@ import argparse import os import sys - +from sentry_sdk import capture_exception from httprunner import __description__, __version__ from httprunner.api import HttpRunner from httprunner.compat import is_py2 @@ -101,8 +101,9 @@ def main(): report_file=args.report_file ) err_code |= (0 if summary and summary["success"] else 1) - except Exception: + except Exception as ex: color_print("!!!!!!!!!! exception stage: {} !!!!!!!!!!".format(runner.exception_stage), "YELLOW") + capture_exception(ex) raise return err_code diff --git a/pyproject.toml b/pyproject.toml index cdc3defa..4b83ec9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "httprunner" -version = "2.4.5" +version = "2.4.6" description = "One-stop solution for HTTP(S) testing." license = "Apache-2.0" readme = "README.md"