From 0d8aeba3ee66c34072e2deb135b85016aefaf0dc Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 3 Jun 2021 18:57:07 +0530 Subject: [PATCH] fix: Update coverage omit files Files that don't end with .py or .pyo ot .pyc are automatically skipped by coveragepy. Updated omit list accordingly to remove non python importable files. ref: https://coverage.readthedocs.io/en/coverage-5.5/source.html#execution --- .github/workflows/server-mariadb-tests.yml | 1 - frappe/commands/utils.py | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/server-mariadb-tests.yml b/.github/workflows/server-mariadb-tests.yml index 1c7655528c..2476102e3d 100644 --- a/.github/workflows/server-mariadb-tests.yml +++ b/.github/workflows/server-mariadb-tests.yml @@ -91,7 +91,6 @@ jobs: DB: mariadb TYPE: server - - name: Run Tests run: cd ~/frappe-bench/ && bench --site test_site run-parallel-tests --use-orchestrator --with-coverage env: diff --git a/frappe/commands/utils.py b/frappe/commands/utils.py index bcb1749644..306f6278cf 100644 --- a/frappe/commands/utils.py +++ b/frappe/commands/utils.py @@ -573,18 +573,15 @@ def run_tests(context, app=None, module=None, doctype=None, test=(), profile=Fal # Generate coverage report only for app that is being tested source_path = os.path.join(get_bench_path(), 'apps', app or 'frappe') omit=[ - '*.html', - '*.js', - '*.xml', - '*.css', - '*.less', - '*.scss', - '*.vue', + '*.pyc', + '*/test_*', + '*/node_modules/*', '*/doctype/*/*_dashboard.py', '*/patches/*' ] if not app or app == 'frappe': + omit.append('*/tests/*') omit.append('*/commands/*') cov = Coverage(source=[source_path], omit=omit)