public inbox for [email protected]
help / color / mirror / Atom feed[pgAdmin[RM6062] Code coverage does not cover function or class definitions
2+ messages / 2 participants
[nested] [flat]
* [pgAdmin[RM6062] Code coverage does not cover function or class definitions
@ 2020-12-04 09:56 Aditya Toshniwal <[email protected]>
2020-12-06 13:55 ` Re: [pgAdmin[RM6062] Code coverage does not cover function or class definitions Akshay Joshi <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Aditya Toshniwal @ 2020-12-04 09:56 UTC (permalink / raw)
To: pgadmin-hackers
Hi Hackers,
Attached code will remove the existing code coverage code and recommend to
use the "coverage" command line instead.
Existing coverage does not cover class and function declarations.
Please review.
--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
<http://edbpostgres.com;
"Don't Complain about Heat, Plant a TREE"
Attachments:
[application/octet-stream] RM6062.patch (3.4K, 3-RM6062.patch)
download | inline diff:
diff --git a/.gitignore b/.gitignore
index 50274f4d9..31b8d65a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,4 +51,8 @@ auditjs.html
auditpy.txt
/venv/
.scannerwork/
-web/coverage/
\ No newline at end of file
+web/coverage/
+web/.coverage
+web/regression/.coverage
+web/regression/covhtml/
+web/regression/htmlcov/
diff --git a/web/regression/README b/web/regression/README
index a17bd955d..c52ef9478 100644
--- a/web/regression/README
+++ b/web/regression/README
@@ -279,13 +279,16 @@ How to generate code coverage report for API test-suite?
- Run coverage
With all modules
- run 'python runtests.py --coverage --exclude feature_tests'
+ run `coverage run ./runtests.py --exclude feature_tests`
With specific module
- run 'python runtests.py --pkg browser.server_groups.servers.tests --coverage'
-
-- After execution of coverage, we will see code coverage report on console.
- For a nicer presentation, '/regression/covhtml' directory gets created.
- Open 'index.html' file in browser and you will see detail coverage report.
+ run `coverage run ./runtests.py --exclude feature_tests --pkg browser.server_groups.servers.tests`
+
+- After execution of coverage, you can run the following to see the code coverage report:
+ Normal report:
+ run `coverage report`
+ HTML report:
+ run `coverage html`
+ This will create a directory 'htmlcov'. Open 'index.html' file in browser and you will see detail coverage report.
Javascript Tests:
diff --git a/web/regression/runtests.py b/web/regression/runtests.py
index 6b1d3171e..a62358fac 100644
--- a/web/regression/runtests.py
+++ b/web/regression/runtests.py
@@ -19,7 +19,6 @@ import sys
import traceback
import json
import random
-import coverage
import threading
import time
import unittest
@@ -49,8 +48,6 @@ if sys.path[0] != root:
from pgadmin import create_app
import config
-COVERAGE_CONFIG_FILE = os.path.join(CURRENT_PATH, ".coveragerc")
-
if config.SERVER_MODE is True:
config.SECURITY_RECOVERABLE = True
config.SECURITY_CHANGEABLE = True
@@ -357,8 +354,6 @@ def add_arguments():
help='Skips execution of the test cases of particular package and '
'sub-packages'
)
- parser.add_argument('--coverage', nargs='?', const=True, type=bool,
- default=False, help='Enable code coverage feature')
parser.add_argument(
'--default_browser',
help='Executes the feature test in specific browser'
@@ -776,11 +771,6 @@ if __name__ == '__main__':
if args['pkg'] is not None:
node_name = args['pkg'].split('.')[-1]
- # Start coverage
- if test_utils.is_coverage_enabled(args):
- cov = coverage.Coverage(config_file=COVERAGE_CONFIG_FILE)
- cov.start()
-
# Check if feature tests included & parallel tests switch passed
if test_utils.is_feature_test_included(args) and \
test_utils.is_parallel_ui_tests(args):
@@ -887,15 +877,6 @@ if __name__ == '__main__':
raise
print_test_results()
- # Stop code coverage
- if test_utils.is_coverage_enabled(args):
- cov.stop()
- cov.save()
-
- # Print coverage only if coverage args given in command line
- if test_utils.is_coverage_enabled(args):
- test_utils.print_and_store_coverage_report(cov)
-
print("Please check output in file: %s/regression.log\n" % CURRENT_PATH)
# Unset environment variable
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgAdmin[RM6062] Code coverage does not cover function or class definitions
2020-12-04 09:56 [pgAdmin[RM6062] Code coverage does not cover function or class definitions Aditya Toshniwal <[email protected]>
@ 2020-12-06 13:55 ` Akshay Joshi <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Akshay Joshi @ 2020-12-06 13:55 UTC (permalink / raw)
To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers
Thanks, patch applied.
On Fri, Dec 4, 2020 at 3:26 PM Aditya Toshniwal <
[email protected]> wrote:
> Hi Hackers,
>
> Attached code will remove the existing code coverage code and recommend to
> use the "coverage" command line instead.
> Existing coverage does not cover class and function declarations.
>
> Please review.
>
> --
> Thanks,
> Aditya Toshniwal
> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
> <http://edbpostgres.com;
> "Don't Complain about Heat, Plant a TREE"
>
--
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*
*Mobile: +91 976-788-8246*
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-12-06 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 09:56 [pgAdmin[RM6062] Code coverage does not cover function or class definitions Aditya Toshniwal <[email protected]>
2020-12-06 13:55 ` Akshay Joshi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox