Commit 9fb05290 by JonahStanley

Sauce can only connect on certain ports

parent 3cf80837
...@@ -18,7 +18,12 @@ DEBUG = True ...@@ -18,7 +18,12 @@ DEBUG = True
import logging import logging
logging.disable(logging.ERROR) logging.disable(logging.ERROR)
import os import os
import random from random import choice
PORTS = [80, 443, 888, 2000, 2001, 2020, 2109, 2222, 2310, 3000, 3001,
3030, 3210, 3333, 4000, 4001, 4040, 4321, 4502, 4503, 5000, 5001,
5050, 5555, 5432, 6000, 6001, 6060, 6666, 6543, 7000, 7070, 7774,
7777, 8000, 8001, 8003, 8031, 8080, 8081, 8765, 8888, 9000, 9001,
9080, 9090, 9876, 9999, 49221, 55001]
def seed(): def seed():
...@@ -92,11 +97,11 @@ MITX_FEATURES['SAUCE'] = { ...@@ -92,11 +97,11 @@ MITX_FEATURES['SAUCE'] = {
'DEVICE' : '', 'DEVICE' : '',
'SESSION' : 'Lettuce Tests', 'SESSION' : 'Lettuce Tests',
'BUILD' : 'CMS TESTS', 'BUILD' : 'CMS TESTS',
'TAGS' : '' 'CUSTOM_TAGS' : {}
} }
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command # Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
INSTALLED_APPS += ('lettuce.django',) INSTALLED_APPS += ('lettuce.django',)
LETTUCE_APPS = ('contentstore',) LETTUCE_APPS = ('contentstore',)
LETTUCE_SERVER_PORT = random.randint(1024, 65535) LETTUCE_SERVER_PORT = choice(PORTS)
LETTUCE_BROWSER = 'chrome' LETTUCE_BROWSER = 'chrome'
...@@ -62,7 +62,7 @@ desired_capabilities['version'] = SAUCE.get('VERSION', '') ...@@ -62,7 +62,7 @@ desired_capabilities['version'] = SAUCE.get('VERSION', '')
desired_capabilities['device-type'] = SAUCE.get('DEVICE', '') desired_capabilities['device-type'] = SAUCE.get('DEVICE', '')
desired_capabilities['name'] = SAUCE.get('SESSION', 'Lettuce Tests') desired_capabilities['name'] = SAUCE.get('SESSION', 'Lettuce Tests')
desired_capabilities['build'] = SAUCE.get('BUILD', 'edX Plaform') desired_capabilities['build'] = SAUCE.get('BUILD', 'edX Plaform')
desired_capabilities['tags'] = SAUCE.get('TAGS', '') desired_capabilities['custom-data'] = SAUCE.get('CUSTOM_TAGS', '')
desired_capabilities['video-upload-on-pass'] = False desired_capabilities['video-upload-on-pass'] = False
desired_capabilities['sauce-advisor'] = False desired_capabilities['sauce-advisor'] = False
desired_capabilities['record-screenshots'] = False desired_capabilities['record-screenshots'] = False
...@@ -104,12 +104,13 @@ def initial_setup(server): ...@@ -104,12 +104,13 @@ def initial_setup(server):
url="http://{}:{}@ondemand.saucelabs.com:80/wd/hub".format(config['username'],config['access-key']), url="http://{}:{}@ondemand.saucelabs.com:80/wd/hub".format(config['username'],config['access-key']),
**desired_capabilities **desired_capabilities
) )
global jobid
jobid = world.browser.driver.session_id
else: else:
world.browser = Browser(browser_driver) world.browser = Browser(browser_driver)
world.browser.driver.implicitly_wait(30) world.browser.driver.implicitly_wait(30)
global jobid
jobid = world.browser.driver.session_id
# Try to visit the main page # Try to visit the main page
# If the browser session is invalid, this will # If the browser session is invalid, this will
# raise a WebDriverException # raise a WebDriverException
......
...@@ -19,8 +19,12 @@ DEBUG = True ...@@ -19,8 +19,12 @@ DEBUG = True
import logging import logging
logging.disable(logging.ERROR) logging.disable(logging.ERROR)
import os import os
import random from random import choice
PORTS = [80, 443, 888, 2000, 2001, 2020, 2109, 2222, 2310, 3000, 3001,
3030, 3210, 3333, 4000, 4001, 4040, 4321, 4502, 4503, 5000, 5001,
5050, 5555, 5432, 6000, 6001, 6060, 6666, 6543, 7000, 7070, 7774,
7777, 8000, 8001, 8003, 8031, 8080, 8081, 8765, 8888, 9000, 9001,
9080, 9090, 9876, 9999, 49221, 55001]
def seed(): def seed():
return os.getppid() return os.getppid()
...@@ -67,7 +71,7 @@ DATABASES = { ...@@ -67,7 +71,7 @@ DATABASES = {
# Set up XQueue information so that the lms will send # Set up XQueue information so that the lms will send
# requests to a mock XQueue server running locally # requests to a mock XQueue server running locally
XQUEUE_PORT = random.randint(1024, 65535) XQUEUE_PORT = choice(PORTS)
XQUEUE_INTERFACE = { XQUEUE_INTERFACE = {
"url": "http://127.0.0.1:%d" % XQUEUE_PORT, "url": "http://127.0.0.1:%d" % XQUEUE_PORT,
"django_auth": { "django_auth": {
...@@ -99,12 +103,12 @@ MITX_FEATURES['SAUCE'] = { ...@@ -99,12 +103,12 @@ MITX_FEATURES['SAUCE'] = {
'VERSION' : '', 'VERSION' : '',
'DEVICE' : '', 'DEVICE' : '',
'SESSION' : 'Lettuce Tests', 'SESSION' : 'Lettuce Tests',
'BUILD' : 'LMS TESTS', 'BUILD' : 'CMS TESTS',
'TAGS' : '' 'CUSTOM_TAGS' : {}
} }
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command # Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
INSTALLED_APPS += ('lettuce.django',) INSTALLED_APPS += ('lettuce.django',)
LETTUCE_APPS = ('courseware',) LETTUCE_APPS = ('courseware',)
LETTUCE_SERVER_PORT = random.randint(1024, 65535) LETTUCE_SERVER_PORT = choice(PORTS)
LETTUCE_BROWSER = 'chrome' LETTUCE_BROWSER = 'chrome'
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