mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 11:29:48 +08:00
fix #819: maximum recursion error in locusts, caused by sentry sdk
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
**Fixed**
|
||||
|
||||
- fix #826: Windows does not support file name include ":"
|
||||
- fix #819: maximum recursion error in locusts
|
||||
|
||||
## 2.5.1 (2020-01-02)
|
||||
|
||||
|
||||
@@ -2,15 +2,3 @@ __version__ = "2.5.2"
|
||||
__description__ = "One-stop solution for HTTP(S) testing."
|
||||
|
||||
__all__ = ["__version__", "__description__"]
|
||||
|
||||
import uuid
|
||||
|
||||
import sentry_sdk
|
||||
|
||||
sentry_sdk.init(
|
||||
dsn="https://cc6dd86fbe9f4e7fbd95248cfcff114d@sentry.io/1862849",
|
||||
release="httprunner@{}".format(__version__)
|
||||
)
|
||||
|
||||
with sentry_sdk.configure_scope() as scope:
|
||||
scope.set_user({"id": uuid.getnode()})
|
||||
|
||||
@@ -2,7 +2,7 @@ import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
from sentry_sdk import capture_exception
|
||||
import sentry_sdk
|
||||
|
||||
from httprunner import __description__, __version__, exceptions
|
||||
from httprunner.api import HttpRunner
|
||||
@@ -11,7 +11,9 @@ from httprunner.loader import load_cases
|
||||
from httprunner.logger import color_print, log_error
|
||||
from httprunner.report import gen_html_report
|
||||
from httprunner.utils import (create_scaffold, get_python2_retire_msg,
|
||||
prettify_json_file)
|
||||
prettify_json_file, init_sentry_sdk)
|
||||
|
||||
init_sentry_sdk()
|
||||
|
||||
|
||||
def main():
|
||||
@@ -115,7 +117,7 @@ def main():
|
||||
except Exception as ex:
|
||||
color_print("!!!!!!!!!! exception stage: {} !!!!!!!!!!".format(runner.exception_stage), "YELLOW")
|
||||
color_print(str(ex), "RED")
|
||||
capture_exception(ex)
|
||||
sentry_sdk.capture_exception(ex)
|
||||
err_code = 1
|
||||
|
||||
sys.exit(err_code)
|
||||
|
||||
0
httprunner/ext/har2case/__init__.py
Normal file
0
httprunner/ext/har2case/__init__.py
Normal file
@@ -19,6 +19,9 @@ import os
|
||||
import sys
|
||||
|
||||
from httprunner import logger
|
||||
from httprunner.utils import init_sentry_sdk
|
||||
|
||||
init_sentry_sdk()
|
||||
|
||||
|
||||
def parse_locustfile(file_path):
|
||||
|
||||
@@ -7,15 +7,28 @@ import itertools
|
||||
import json
|
||||
import os.path
|
||||
import re
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from httprunner import exceptions, logger
|
||||
import sentry_sdk
|
||||
|
||||
from httprunner import exceptions, logger, __version__
|
||||
from httprunner.compat import basestring, bytes, is_py2
|
||||
from httprunner.exceptions import ParamsError
|
||||
|
||||
absolute_http_url_regexp = re.compile(r"^https?://", re.I)
|
||||
|
||||
|
||||
def init_sentry_sdk():
|
||||
sentry_sdk.init(
|
||||
dsn="https://cc6dd86fbe9f4e7fbd95248cfcff114d@sentry.io/1862849",
|
||||
release="httprunner@{}".format(__version__)
|
||||
)
|
||||
|
||||
with sentry_sdk.configure_scope() as scope:
|
||||
scope.set_user({"id": uuid.getnode()})
|
||||
|
||||
|
||||
def set_os_environ(variables_mapping):
|
||||
""" set variables mapping to os.environ
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user