Merge pull request #16478 from edx/youngstrom/remove_a11y_coverage
Remove coverage reports for a11y and bok-choy tests
This commit is contained in:
@@ -51,6 +51,7 @@ def test_bokchoy(options, passthrough_options):
|
||||
# firefox as the default here.
|
||||
using_firefox = (os.environ.get('SELENIUM_BROWSER', 'firefox') == 'firefox')
|
||||
validate_firefox = getattr(options, 'validate_firefox_version', using_firefox)
|
||||
options.test_bokchoy.coveragerc = options.get('coveragerc', None)
|
||||
|
||||
if validate_firefox:
|
||||
check_firefox_version()
|
||||
@@ -81,8 +82,8 @@ def test_a11y(options, passthrough_options):
|
||||
# Modify the options object directly, so that any subsequently called tasks
|
||||
# that share with this task get the modified options
|
||||
options.test_a11y.report_dir = Env.BOK_CHOY_A11Y_REPORT_DIR
|
||||
options.test_a11y.coveragerc = Env.BOK_CHOY_A11Y_COVERAGERC
|
||||
options.test_a11y.extra_args = options.get('extra_args', '') + ' -a "a11y" '
|
||||
options.test_a11y.coveragerc = options.get('coveragerc', None)
|
||||
run_bokchoy(options.test_a11y, passthrough_options)
|
||||
|
||||
|
||||
@@ -120,7 +121,7 @@ def pa11ycrawler(options, passthrough_options):
|
||||
# Modify the options object directly, so that any subsequently called tasks
|
||||
# that share with this task get the modified options
|
||||
options.pa11ycrawler.report_dir = Env.PA11YCRAWLER_REPORT_DIR
|
||||
options.pa11ycrawler.coveragerc = Env.PA11YCRAWLER_COVERAGERC
|
||||
options.pa11ycrawler.coveragerc = options.get('coveragerc', None)
|
||||
options.pa11ycrawler.should_fetch_course = getattr(
|
||||
options,
|
||||
'should_fetch_course',
|
||||
|
||||
@@ -41,9 +41,7 @@ class TestPaverBokChoyCmd(unittest.TestCase):
|
||||
),
|
||||
"SELENIUM_DRIVER_LOG_DIR='{}/test_root/log{}'".format(REPO_DIR, shard_str),
|
||||
"VERIFY_XSS='{}'".format(verify_xss),
|
||||
"coverage",
|
||||
"run",
|
||||
"--rcfile={}".format(Env.BOK_CHOY_COVERAGERC),
|
||||
"python",
|
||||
"-m",
|
||||
"pytest",
|
||||
"{}/common/test/acceptance/{}".format(REPO_DIR, name),
|
||||
|
||||
@@ -26,7 +26,6 @@ BOKCHOY_EVAL_ATTR = make_option(
|
||||
BOKCHOY_FASTTEST = make_option('--fasttest', action='store_true', help='Skip some setup')
|
||||
BOKCHOY_COVERAGERC = make_option(
|
||||
'--coveragerc',
|
||||
default=Env.BOK_CHOY_COVERAGERC,
|
||||
help='coveragerc file to use during this test'
|
||||
)
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ def start_servers(options):
|
||||
"""
|
||||
Start the servers we will run tests on, returns PIDs for servers.
|
||||
"""
|
||||
coveragerc = options.get('coveragerc', Env.BOK_CHOY_COVERAGERC)
|
||||
coveragerc = options.get('coveragerc', None)
|
||||
|
||||
def start_server(cmd, logfile, cwd=None):
|
||||
"""
|
||||
@@ -41,13 +41,14 @@ def start_servers(options):
|
||||
|
||||
for service, info in Env.BOK_CHOY_SERVERS.iteritems():
|
||||
address = "0.0.0.0:{}".format(info['port'])
|
||||
cmd = (
|
||||
"DEFAULT_STORE={default_store} "
|
||||
"coverage run --rcfile={coveragerc} -m "
|
||||
cmd = ("DEFAULT_STORE={default_store} ").format(default_store=options.default_store)
|
||||
if coveragerc:
|
||||
cmd += ("coverage run --rcfile={coveragerc} -m ").format(coveragerc=coveragerc)
|
||||
else:
|
||||
cmd += "python -m "
|
||||
cmd += (
|
||||
"manage {service} --settings {settings} runserver "
|
||||
"{address} --traceback --noreload".format(
|
||||
default_store=options.default_store,
|
||||
coveragerc=coveragerc,
|
||||
service=service,
|
||||
settings=Env.SETTINGS,
|
||||
address=address,
|
||||
|
||||
@@ -205,7 +205,7 @@ class BokChoyTestSuite(TestSuite):
|
||||
self.har_dir = self.log_dir / 'hars'
|
||||
self.a11y_file = Env.BOK_CHOY_A11Y_CUSTOM_RULES_FILE
|
||||
self.imports_dir = kwargs.get('imports_dir', None)
|
||||
self.coveragerc = kwargs.get('coveragerc', Env.BOK_CHOY_COVERAGERC)
|
||||
self.coveragerc = kwargs.get('coveragerc', None)
|
||||
self.save_screenshots = kwargs.get('save_screenshots', False)
|
||||
|
||||
def __enter__(self):
|
||||
@@ -333,12 +333,16 @@ class BokChoyTestSuite(TestSuite):
|
||||
]
|
||||
if self.save_screenshots:
|
||||
cmd.append("NEEDLE_SAVE_BASELINE=True")
|
||||
cmd += [
|
||||
"coverage",
|
||||
"run",
|
||||
]
|
||||
if self.coveragerc:
|
||||
cmd += [
|
||||
"coverage",
|
||||
"run",
|
||||
]
|
||||
cmd.append("--rcfile={}".format(self.coveragerc))
|
||||
else:
|
||||
cmd += [
|
||||
"python"
|
||||
]
|
||||
cmd += [
|
||||
"-m",
|
||||
"pytest",
|
||||
|
||||
@@ -8,14 +8,8 @@ source scripts/jenkins-common.sh
|
||||
echo "Running explicit accessibility tests..."
|
||||
SELENIUM_BROWSER=phantomjs paver test_a11y
|
||||
|
||||
echo "Generating coverage report..."
|
||||
paver a11y_coverage
|
||||
|
||||
# The settings that we use are installed with the pa11ycrawler module
|
||||
export SCRAPY_SETTINGS_MODULE='pa11ycrawler.settings'
|
||||
|
||||
echo "Running pa11ycrawler against test course..."
|
||||
paver pa11ycrawler --fasttest --skip-clean --fetch-course --with-html
|
||||
|
||||
echo "Generating pa11ycrawler coverage report..."
|
||||
paver pa11ycrawler_coverage
|
||||
|
||||
Reference in New Issue
Block a user