Commit ee23b9d1 by JonahStanley

Changed method of obtaining feature flags to environment variables

Conflicts:
	common/djangoapps/terrain/browser.py
parent 9fb05290
......@@ -25,6 +25,16 @@ PORTS = [80, 443, 888, 2000, 2001, 2020, 2109, 2222, 2310, 3000, 3001,
7777, 8000, 8001, 8003, 8031, 8080, 8081, 8765, 8888, 9000, 9001,
9080, 9090, 9876, 9999, 49221, 55001]
DESIRED_CAPABILITIES={
'chrome': DesiredCapabilities.CHROME,
'internet explorer': DesiredCapabilities.INTERNETEXPLORER,
'firefox': DesiredCapabilities.FIREFOX,
'opera': DesiredCapabilities.OPERA,
'iphone': DesiredCapabilities.IPHONE,
'ipad': DesiredCapabilities.IPAD,
'safari': DesiredCapabilities.SAFARI,
'android': DesiredCapabilities.ANDROID
}
def seed():
return os.getppid()
......@@ -88,15 +98,15 @@ USE_I18N = True
# Information needed to utilize Sauce Labs.
MITX_FEATURES['SAUCE'] = {
'USE' : False,
'USERNAME' : '<USERNAME>',
'ACCESS_ID' : '<ACCESS_ID>',
'BROWSER' : DesiredCapabilities.CHROME,
'PLATFORM' : 'Linux',
'VERSION' : '',
'DEVICE' : '',
'SESSION' : 'Lettuce Tests',
'BUILD' : 'CMS TESTS',
'ENABLED' : os.environ.get('ENABLED'),
'USERNAME' : os.environ.get('SAUCE_USER_NAME'),
'ACCESS_ID' : os.environ.get('SAUCE_API_KEY'),
'BROWSER' : DESIRED_CAPABILITIES.get(os.environ.get('SAUCE_BROWSER')),
'PLATFORM' : os.environ.get('SAUCE_PLATFORM'),
'VERSION' : os.environ.get('SAUCE_VERSION'),
'DEVICE' : os.environ.get('SAUCE_DEVICE'),
'SESSION' : 'Jenkins Acceptance Tests',
'BUILD' : os.environ.get('JOB_NAME'),
'CUSTOM_TAGS' : {}
}
......
......@@ -98,7 +98,7 @@ def initial_setup(server):
while (not success) and num_attempts < MAX_VALID_BROWSER_ATTEMPTS:
# Get a browser session
if SAUCE.get('USE'):
if SAUCE.get('ENABLED'):
world.browser = Browser(
'remote',
url="http://{}:{}@ondemand.saucelabs.com:80/wd/hub".format(config['username'],config['access-key']),
......@@ -130,7 +130,7 @@ def initial_setup(server):
raise IOError("Could not acquire valid {driver} browser session.".format(driver='remote'))
# Set the browser size to 1280x1024
if not SAUCE.get('USE'):
if not SAUCE.get('ENABLED'):
world.browser.driver.set_window_size(1280, 1024)
......@@ -181,6 +181,6 @@ def teardown_browser(total):
"""
Quit the browser after executing the tests.
"""
if SAUCE.get('USE'):
if SAUCE.get('ENABLED'):
set_job_status(jobid, total.scenarios_ran == total.scenarios_passed)
world.browser.quit()
......@@ -26,6 +26,17 @@ PORTS = [80, 443, 888, 2000, 2001, 2020, 2109, 2222, 2310, 3000, 3001,
7777, 8000, 8001, 8003, 8031, 8080, 8081, 8765, 8888, 9000, 9001,
9080, 9090, 9876, 9999, 49221, 55001]
DESIRED_CAPABILITIES={
'chrome': DesiredCapabilities.CHROME,
'internet explorer': DesiredCapabilities.INTERNETEXPLORER,
'firefox': DesiredCapabilities.FIREFOX,
'opera': DesiredCapabilities.OPERA,
'iphone': DesiredCapabilities.IPHONE,
'ipad': DesiredCapabilities.IPAD,
'safari': DesiredCapabilities.SAFARI,
'android': DesiredCapabilities.ANDROID
}
def seed():
return os.getppid()
......@@ -95,15 +106,15 @@ USE_I18N = True
# Information needed to utilize Sauce Labs.
MITX_FEATURES['SAUCE'] = {
'USE' : False,
'USERNAME' : '<USERNAME>',
'ACCESS_ID' : '<ACCESS_ID>',
'BROWSER' : DesiredCapabilities.CHROME,
'PLATFORM' : 'Linux',
'VERSION' : '',
'DEVICE' : '',
'SESSION' : 'Lettuce Tests',
'BUILD' : 'CMS TESTS',
'ENABLED' : os.environ.get('ENABLED'),
'USERNAME' : os.environ.get('SAUCE_USER_NAME'),
'ACCESS_ID' : os.environ.get('SAUCE_API_KEY'),
'BROWSER' : DESIRED_CAPABILITIES.get(os.environ.get('SAUCE_BROWSER')),
'PLATFORM' : os.environ.get('SAUCE_PLATFORM'),
'VERSION' : os.environ.get('SAUCE_VERSION'),
'DEVICE' : os.environ.get('SAUCE_DEVICE'),
'SESSION' : 'Jenkins Acceptance Tests',
'BUILD' : os.environ.get('JOB_NAME'),
'CUSTOM_TAGS' : {}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment