Ensure that code coverage should cover class and function declarations. Fixes #6062

This commit is contained in:
Aditya Toshniwal
2020-12-06 19:16:17 +05:30
committed by Akshay Joshi
parent 146da066b0
commit ca4db8871e
4 changed files with 14 additions and 25 deletions

View File

@@ -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