From 138495bac170fa01da165c6486ddb759efe2ec9f Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 23 Dec 2019 23:21:54 +0800 Subject: [PATCH 1/3] feat: report user id to sentry --- docs/CHANGELOG.md | 6 ++++++ httprunner/__init__.py | 7 ++++++- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 08363413..47e71db7 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 2.4.7 (2019-12-24) + +**Added** + +- feat: report user id to sentry + ## 2.4.6 (2019-12-23) **Added** diff --git a/httprunner/__init__.py b/httprunner/__init__.py index 5beb3a6c..209b37a6 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -1,11 +1,16 @@ -__version__ = "2.4.6" +__version__ = "2.4.7" __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()}) diff --git a/pyproject.toml b/pyproject.toml index 4b83ec9c..71852f9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "httprunner" -version = "2.4.6" +version = "2.4.7" description = "One-stop solution for HTTP(S) testing." license = "Apache-2.0" readme = "README.md" From 38cbd4082e1f4cec40ef3ffe4cfc4a3b98c65501 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Tue, 24 Dec 2019 15:03:18 +0800 Subject: [PATCH 2/3] fix #797: locusts command error --- docs/CHANGELOG.md | 4 ++++ docs/Installation.md | 2 +- httprunner/ext/locusts/README.md | 2 +- pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 47e71db7..ebfe8ca4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,6 +6,10 @@ - feat: report user id to sentry +**Fixed** + +- fix #797: locusts command error + ## 2.4.6 (2019-12-23) **Added** diff --git a/docs/Installation.md b/docs/Installation.md index dce2f93b..dc3ed753 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -132,7 +132,7 @@ requests-toolbelt 0.9.1 A utility belt for advanced users of python-requests $ poetry run python -m httprunner -h # 调试运行 locusts -$ pipenv run python -m httprunner.plugins.locusts -h +$ pipenv run python -m httprunner.ext.locusts -h ``` ## Docker diff --git a/httprunner/ext/locusts/README.md b/httprunner/ext/locusts/README.md index 831e84d7..6b52620e 100644 --- a/httprunner/ext/locusts/README.md +++ b/httprunner/ext/locusts/README.md @@ -17,7 +17,7 @@ $ locusts -f xxx.yml --processes ``` ```shell script -$ python3 -m httprunner.plugins.locusts -h +$ python3 -m httprunner.ext.locusts -h Usage: locust [options] [LocustClass [LocustClass2 ... ]] diff --git a/pyproject.toml b/pyproject.toml index 71852f9b..363bf55f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ coverage = "^4.5.4" hrun = "httprunner.cli:main" ate = "httprunner.cli:main" httprunner = "httprunner.cli:main" -locusts = "httprunner.plugins.locusts.cli:main" +locusts = "httprunner.ext.locusts.cli:main" [build-system] requires = ["poetry>=1.0.0"] From f3ce7ce8763ca3e8c8c5b3616ae1e2d6b5bf92de Mon Sep 17 00:00:00 2001 From: debugtalk Date: Tue, 24 Dec 2019 15:07:12 +0800 Subject: [PATCH 3/3] test: add integration test for locusts command --- .github/workflows/integration_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index f9e8c5e5..f52194e8 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -30,6 +30,7 @@ jobs: poetry build ls dist/*.whl | xargs pip install # test installation hrun -V + locusts -V - name: Run smoketest for hrun command run: | cd tests/httpbin && hrun basic.yml --failfast && cd -