forked from geocoders/geocoder-tester
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request geocoders#20 from amatissart/allure
WIP: Allure integration
- Loading branch information
Showing
7 changed files
with
360 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
__pycache__ | ||
*.pyc | ||
reports/* | ||
|
||
allure/res* | ||
allure/allure-report/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[[source]] | ||
|
||
name = "pypi" | ||
url = "https://pypi.python.org/simple" | ||
verify_ssl = true | ||
|
||
|
||
[packages] | ||
|
||
pytest = "*" | ||
requests = "*" | ||
pyaml = "*" | ||
geopy = "*" | ||
unidecode = "*" | ||
allure-pytest = "*" | ||
invoke = "*" | ||
|
||
|
||
[dev-packages] | ||
|
||
ipython = "*" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
api_url: | ||
tests_files: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from datetime import datetime | ||
import invoke | ||
from invoke import task | ||
from os import path | ||
|
||
@task | ||
def generate_report(ctx, results_dir): | ||
print('Generating Allure report...') | ||
with ctx.cd('allure'): | ||
if path.exists('{}/allure-report/history'.format(ctx.cwd)): | ||
ctx.run('mv allure-report/history {}'.format(results_dir)) | ||
ctx.run('allure generate {} --clean'.format(results_dir)) | ||
|
||
|
||
@task(default=True) | ||
def run_tests(ctx): | ||
dt_now = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S') | ||
results_dir = 'res_{}'.format(dt_now) | ||
|
||
ctx.run(""" | ||
pytest {tests_files} --api-url {api_url} \ | ||
--loose-compare --tb=short --alluredir allure/{results_dir} | ||
""".format( | ||
tests_files=ctx.tests_files, | ||
api_url=ctx.api_url, | ||
results_dir=results_dir | ||
), | ||
warn=True | ||
) | ||
|
||
generate_report(ctx, results_dir) |