Merge pull request #15398 from edx/jmbowman/PLAT-1229
PLAT-1229 Support for JS tests in Docker devstack
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
//
|
||||
|
||||
/* eslint-env node */
|
||||
/* globals process */
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -267,6 +268,11 @@ function getBaseConfig(config, useRequireJs) {
|
||||
});
|
||||
};
|
||||
|
||||
var hostname = 'localhost';
|
||||
if (process.env.hasOwnProperty('BOK_CHOY_HOSTNAME')) {
|
||||
hostname = process.env.BOK_CHOY_HOSTNAME;
|
||||
}
|
||||
|
||||
initFrameworks.$inject = ['config.files'];
|
||||
|
||||
var customPlugin = {
|
||||
@@ -290,6 +296,7 @@ function getBaseConfig(config, useRequireJs) {
|
||||
'karma-chrome-launcher',
|
||||
'karma-firefox-launcher',
|
||||
'karma-spec-reporter',
|
||||
'karma-webdriver-launcher',
|
||||
'karma-webpack',
|
||||
'karma-sourcemap-loader',
|
||||
customPlugin
|
||||
@@ -315,7 +322,8 @@ function getBaseConfig(config, useRequireJs) {
|
||||
junitReporter: junitSettings(config),
|
||||
|
||||
|
||||
// web server port
|
||||
// web server hostname and port
|
||||
hostname: hostname,
|
||||
port: 9876,
|
||||
|
||||
|
||||
@@ -345,6 +353,14 @@ function getBaseConfig(config, useRequireJs) {
|
||||
'app.update.auto': false,
|
||||
'app.update.enabled': false
|
||||
}
|
||||
},
|
||||
FirefoxDocker: {
|
||||
base: 'WebDriver',
|
||||
browserName: 'firefox',
|
||||
config: {
|
||||
hostname: 'edx.devstack.firefox',
|
||||
port: 4444
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
"karma-requirejs": "^0.2.6",
|
||||
"karma-sourcemap-loader": "^0.3.7",
|
||||
"karma-spec-reporter": "^0.0.20",
|
||||
"karma-webdriver-launcher": "^1.0.5",
|
||||
"karma-webpack": "^2.0.3",
|
||||
"pa11y": "4.0.1",
|
||||
"pa11y-reporter-json-oldnode": "1.0.0",
|
||||
|
||||
@@ -27,7 +27,8 @@ class TestPaverJavaScriptTestTasks(PaverTestCase):
|
||||
u"--single-run={single_run} "
|
||||
u"--capture-timeout=60000 "
|
||||
u"--junitreportpath="
|
||||
u"{platform_root}/reports/javascript/javascript_xunit-{suite}.xml"
|
||||
u"{platform_root}/reports/javascript/javascript_xunit-{suite}.xml "
|
||||
u"--browsers={browser}"
|
||||
)
|
||||
EXPECTED_COVERAGE_OPTIONS = (
|
||||
u' --coverage --coveragereportpath={platform_root}/reports/javascript/coverage-{suite}.xml'
|
||||
@@ -130,6 +131,7 @@ class TestPaverJavaScriptTestTasks(PaverTestCase):
|
||||
single_run='false' if dev_mode else 'true',
|
||||
suite=suite,
|
||||
platform_root=self.platform_root,
|
||||
browser=Env.KARMA_BROWSER,
|
||||
),
|
||||
)
|
||||
if is_coverage:
|
||||
|
||||
@@ -138,6 +138,9 @@ class Env(object):
|
||||
# Test Ids Directory
|
||||
TEST_DIR = REPO_ROOT / ".testids"
|
||||
|
||||
# Configured browser to use for the js test suites
|
||||
KARMA_BROWSER = 'FirefoxDocker' if USING_DOCKER else 'FirefoxNoUpdates'
|
||||
|
||||
# Files used to run each of the js test suites
|
||||
# TODO: Store this as a dict. Order seems to matter for some
|
||||
# reason. See issue TE-415.
|
||||
|
||||
@@ -83,6 +83,7 @@ class JsTestSubSuite(TestSuite):
|
||||
"--single-run={}".format('false' if self.mode == 'dev' else 'true'),
|
||||
"--capture-timeout=60000",
|
||||
"--junitreportpath={}".format(self.xunit_report),
|
||||
"--browsers={}".format(Env.KARMA_BROWSER),
|
||||
]
|
||||
|
||||
if self.port:
|
||||
|
||||
Reference in New Issue
Block a user