diff --git a/.travis.yml b/.travis.yml index d4140c97..1d917f66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,19 +2,18 @@ sudo: false language: python python: - 2.7 - - 3.4 - 3.5 - 3.6 matrix: include: - python: 3.7 - dist: xenial - sudo: true + dist: xenial # Required for Python 3.7 + sudo: true # Required for Python 3.7 install: - - pip install pipenv --upgrade - - pipenv install --dev --skip-lock + - pip install poetry + - poetry install -vvv script: - - pipenv run python setup.py install - - pipenv run coverage run --source=httprunner -m unittest discover + - poetry build + - poetry run coverage run --source=httprunner -m unittest discover after_success: - - pipenv run coveralls \ No newline at end of file + - poetry run coveralls \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 40e9122b..75fa1ffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,41 @@ # Release History -## 2.2.3 +## 2.2.4 (2019-07-13) -**Bugfixes** +**Changed** + +- replace pipenv & setup.py with poetry +- drop support for Python 3.4 as it was EOL on 2019-03-16 +- relocate debugging scripts, move from main-debug.py to httprunner.cli + +**Fixed** + +- fix #574: delete unnecessary code +- fix #551: raise if times is not digit +- fix #572: tests_def_mapping["testcases"] typo error + +## 2.2.3 (2019-06-30) + +**Fixed** - fix yaml FullLoader AttributeError when PyYAML version < 5.1 ## 2.2.2 (2019-06-26) -**Features** +**Changed** - `extract` is used to replace `output` when passing former teststep's (as a testcase) export value to next teststep - `export` is used to replace `output` in testcase config ## 2.2.1 (2019-06-25) -**Features** +**Added** - add demo api/testcase/testsuite to new created scaffold project - update default `.gitignore` of new created scaffold project - add demo content to `debugtalk.py`/`.env` of new created scaffold project -**Bugfixes** +**Fixed** - fix extend with testcase reference in format version 2 - fix ImportError when locustio is not installed @@ -29,31 +43,31 @@ ## 2.2.0 (2019-06-24) -**Features** +**Added** - support testcase/testsuite in format version 2 -**Bugfixes** +**Fixed** - add wheel in dev packages - fix exception when teststep name reference former extracted variable ## 2.1.3 (2019-04-24) -**Bugfixes** +**Fixed** - replace eval mechanism with builtins to prevent security vulnerabilities - ImportError for builtins in Python2.7 ## 2.1.2 (2019-04-17) -**Features** +**Added** - support new variable notation ${var} - use \$\$ to escape \$ notation - add Python 3.7 for travis CI -**Bugfixes** +**Fixed** - match duplicate variable/function in single raw string - escape '{' and '}' notation in raw string @@ -62,7 +76,7 @@ ## 2.1.1 (2019-04-11) -**Features** +**Changed** refactor upload files mechanism with [requests-toolbelt](https://toolbelt.readthedocs.io/en/latest/user.html#multipart-form-data-encoder): @@ -71,41 +85,41 @@ refactor upload files mechanism with [requests-toolbelt](https://toolbelt.readth ## 2.1.0 (2019-04-10) -**Features** +**Added** - implement json dump Python objects when save tests - implement lazy parser - remove project_mapping from parse_tests result -**Bugfixes** +**Fixed** - reference output variables - pass output variables between testcases ## 2.0.6 (2019-03-18) -**Features** +**Added** - create .gitignore file when initializing new project -**Bugfixes** +**Fixed** - fix CSV relative path detection - fix current validators displaying the former one when they are empty ## 2.0.5 (2019-03-04) -**Features** +**Added** - implement method to get variables and output -**Bugfixes** +**Fixed** - fix xss in response json ## 2.0.4 (2019-02-28) -**Bugfixes** +**Fixed** - fix verify priority with nested testcase - fix function in config variables called multiple times @@ -113,7 +127,7 @@ refactor upload files mechanism with [requests-toolbelt](https://toolbelt.readth ## 2.0.3 (2019-02-24) -**Bugfixes** +**Fixed** - fix verify priority: teststep > config - fix Chinese charactor in log_file encoding error in Windows @@ -121,12 +135,12 @@ refactor upload files mechanism with [requests-toolbelt](https://toolbelt.readth ## 2.0.2 (2019-01-21) -**Bugfixes** +**Fixed** - each teststeps in one testcase share the same session - fix duplicate API definition output -**Improvements** +**Changed** - display result from hook functions in DEBUG level log - change log level of "Variables & Output" to INFO @@ -135,15 +149,20 @@ refactor upload files mechanism with [requests-toolbelt](https://toolbelt.readth ## 2.0.1 (2019-01-18) -**Bugfixes** +**Fixed** - override current teststep variables with former testcase output variables -- make compatible with testcase name is empty +- Fixed compatibility when testcase name is empty - skip undefined variable when parsing string content + +**Changed** + - add back request method in report ## 2.0.0 (2019-01-01) +**Changed** + - Massive Refactor and Simplification - Redesign testcase structure - Module pipline diff --git a/Pipfile b/Pipfile deleted file mode 100644 index bee6c544..00000000 --- a/Pipfile +++ /dev/null @@ -1,25 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -requests = "*" -pyyaml = "*" -jinja2 = "*" -har2case = "*" -colorama = "*" -colorlog = "*" -requests-toolbelt = "*" -filetype = "*" - -[dev-packages] -Flask = "<1.0.0" -coverage = "*" -coveralls = "*" -twine = "*" -contextlib2 = "*" -locustio = "*" -wheel = "*" - -[scripts] diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index bdbfd759..00000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -httprunner.org \ No newline at end of file diff --git a/docs/FAQ.md b/docs/FAQ.md deleted file mode 100644 index 38583eb8..00000000 --- a/docs/FAQ.md +++ /dev/null @@ -1,20 +0,0 @@ -## Unable to install PyUnitReport dependency library automatically - -If there is something goes wrong in installation like below. - -```text -Downloading/unpacking PyUnitReport (from HttpRunner) - Could not find any downloads that satisfy the requirement PyUnitReport (from HttpRunner) -``` - -You could install `PyUnitReport` manully at first. - -```bash -$ pip install git+https://github.com/debugtalk/PyUnitReport.git#egg=PyUnitReport -``` - -And then everything will be OK when you reinstall `HttpRunner`. - -```bash -$ pip install git+https://github.com/debugtalk/HttpRunner.git#egg=HttpRunner -``` diff --git a/docs/Installation.md b/docs/Installation.md deleted file mode 100644 index d13a44af..00000000 --- a/docs/Installation.md +++ /dev/null @@ -1,96 +0,0 @@ -## Installation - -`HttpRunner` is available on [`PyPI`][PyPI] and can be installed through pip or easy_install. - -```bash -$ pip install HttpRunner -``` - -or - -```bash -$ easy_install HttpRunner -``` - -If you want to keep up with the latest version, you can install with github repository url. - -```bash -$ pip install git+https://github.com/HttpRunner/HttpRunner.git#egg=HttpRunner -``` - -## Upgrade - -If you have installed `HttpRunner` before and want to upgrade to the latest version, you can use the `-U` option. - -This option works on each installation method described above. - -```bash -$ pip install -U HttpRunner -$ easy_install -U HttpRunner -$ pip install -U git+https://github.com/HttpRunner/HttpRunner.git#egg=HttpRunner -``` - -## Check Installation - -When HttpRunner is installed, a **httprunner** (**hrun** for short) command should be available in your shell (if you're not using -virtualenv—which you should—make sure your python script directory is on your path). - -To see `HttpRunner` version: - -```bash -$ httprunner -V # same as: hrun -V -HttpRunner version: 0.8.1b -PyUnitReport version: 0.1.3b -``` - -To see available options, run: - -```bash -$ httprunner -h # same as: hrun -h -usage: main-debug.py [-h] [-V] [--no-html-report] - [--html-report-name HTML_REPORT_NAME] - [--html-report-template HTML_REPORT_TEMPLATE] - [--log-level LOG_LEVEL] [--log-file LOG_FILE] - [--dot-env-path DOT_ENV_PATH] [--failfast] - [--startproject STARTPROJECT] - [--validate [VALIDATE [VALIDATE ...]]] - [--prettify [PRETTIFY [PRETTIFY ...]]] - [testcase_paths [testcase_paths ...]] - -One-stop solution for HTTP(S) testing. - -positional arguments: - testcase_paths testcase file path - -optional arguments: - -h, --help show this help message and exit - -V, --version show version - --no-html-report do not generate html report. - --html-report-name HTML_REPORT_NAME - specify html report name, only effective when - generating html report. - --html-report-template HTML_REPORT_TEMPLATE - specify html report template path. - --log-level LOG_LEVEL - Specify logging level, default is INFO. - --log-file LOG_FILE Write logs to specified file path. - --dot-env-path DOT_ENV_PATH - Specify .env file path, which is useful for keeping - sensitive data. - --failfast Stop the test run on the first error or failure. - --startproject STARTPROJECT - Specify new project name. - --validate [VALIDATE [VALIDATE ...]] - Validate JSON testcase format. - --prettify [PRETTIFY [PRETTIFY ...]] - Prettify JSON testcase format. -``` - -## Supported Python Versions - -HttpRunner supports Python 2.7, 3.4, 3.5, and 3.6. And we strongly recommend you to use `Python 3.6`. - -`HttpRunner` has been tested on `macOS`, `Linux` and `Windows` platforms. - - -[PyPI]: https://pypi.python.org/pypi diff --git a/docs/Introduction.md b/docs/Introduction.md deleted file mode 100644 index dc65f2ca..00000000 --- a/docs/Introduction.md +++ /dev/null @@ -1,28 +0,0 @@ -# Introduction - -## Design Philosophy - -Take full reuse of Python's existing powerful libraries: [`Requests`][requests], [`unittest`][unittest] and [`Locust`][Locust]. And achieve the goal of API automation test, production environment monitoring, and API performance test, with a concise and elegant manner. - -## Key Features - -- Inherit all powerful features of [`Requests`][requests], just have fun to handle HTTP in human way. -- Define testcases in YAML or JSON format in concise and elegant manner. -- Supports `function`/`variable`/`extract`/`validate` mechanisms to create full test scenarios. -- With `debugtalk.py` plugin, module functions can be auto-discovered in recursive upward directories. -- Testcases can be run in diverse ways, with single testcase, multiple testcases, or entire project folder. -- Test report is concise and clear, with detailed log records. See [`PyUnitReport`][PyUnitReport]. -- With reuse of [`Locust`][Locust], you can run performance test without extra work. -- CLI command supported, perfect combination with [Jenkins][Jenkins]. - -## Learn more - -You can read this [blog][HttpRunner-blog] to learn more about the background and initial thoughts of `HttpRunner`. - - -[requests]: http://docs.python-requests.org/en/master/ -[unittest]: https://docs.python.org/3/library/unittest.html -[Locust]: http://locust.io/ -[PyUnitReport]: https://github.com/HttpRunner/PyUnitReport -[Jenkins]: https://jenkins.io/index.html -[HttpRunner-blog]: http://debugtalk.com/post/ApiTestEngine-api-test-best-practice/ diff --git a/docs/dev-rules.md b/docs/dev-rules.md deleted file mode 100644 index f9dfb589..00000000 --- a/docs/dev-rules.md +++ /dev/null @@ -1,47 +0,0 @@ - -## 版本号(Version) - -从 2.0 版本开始,HttpRunner 开始使用 [`Semantic Versioning`][SemVer] 版本号机制。该机制由 GitHub 联合创始人 Tom Preston-Werner 编写,当前被广泛采用,遵循该机制也可以更好地与开源生态统一,避免出现 “dependency hell” 的情况。 - -具体地,HttpRunner 将采用 `MAJOR.MINOR.PATCH` 的版本号机制。 - -- MAJOR: 重大版本升级并出现前后版本不兼容时加 1 -- MINOR: 大版本内新增功能并且保持版本内兼容性时加 1 -- PATCH: 功能迭代过程中进行问题修复(bugfix)时加 1 - -当然,在实际迭代开发过程中,肯定也不会每次提交(commit)都对 PATCH 加 1;在遵循如上主体原则的前提下,也会根据需要,在版本号后面添加先行版本号(-alpha/beta/rc)或版本编译元数据(+20190101)作为延伸。 - -## 分支策略 - -HttpRunner 的开发分支策略采用 GitHub Flow。 - -![](images/github-flow.png) - -## 提交信息(Commit Message) - -代码提交的注释信息遵循如下格式规范: - -```xml -(): - - - -