Skip to content

Commit

Permalink
Merge pull request #155 from gisce/html_report
Browse files Browse the repository at this point in the history
New option to html  coverage report directly
  • Loading branch information
polsala authored Oct 9, 2024
2 parents 7287bd2 + 004d83b commit 06cd033
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions destral/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@
@click.option('--requirements/--no-requirements', default=True)
@click.option('--enable-lint', type=click.BOOL, default=False, is_flag=True)
@click.option('--constraints-file', type=click.STRING, nargs=1, default="")
@click.option(
'--coverage-html-report', type=click.STRING, nargs=1, default="", help="Coverage HTML report path"
)
def destral(modules, tests, all_tests=None, enable_coverage=None,
report_coverage=None, report_junitxml=None, dropdb=None,
requirements=None, **kwargs):
os.environ['OPENERP_DESTRAL_MODE'] = "1"
enable_lint = kwargs.pop('enable_lint')
constraints_file = kwargs.pop('constraints_file')
coverage_html_report = kwargs.pop('coverage_html_report')
database = kwargs.pop('database')
if database:
os.environ['OPENERP_DB_NAME'] = database
Expand Down Expand Up @@ -172,6 +176,8 @@ def destral(modules, tests, all_tests=None, enable_coverage=None,
coverage.report()
if enable_coverage:
coverage.save()
if coverage.enabled and coverage_html_report:
coverage.html_report(directory=coverage_html_report)

if enable_lint:
modules_path = ['{}/{}'.format(addons_path, m) for m in modules_to_test]
Expand Down

0 comments on commit 06cd033

Please sign in to comment.