Moved stub servers to terrain
Refactored stub services for style and DRY Added unit tests for stub implementations Updated acceptance tests that depend on stubs. Updated Studio acceptance tests to use YouTube stub server; fixed failing tests in devstack.
This commit is contained in:
@@ -152,6 +152,7 @@ SELENIUM_GRID = {
|
||||
'BROWSER': LETTUCE_BROWSER,
|
||||
}
|
||||
|
||||
|
||||
#####################################################################
|
||||
# See if the developer has any local overrides.
|
||||
try:
|
||||
@@ -161,22 +162,9 @@ except ImportError:
|
||||
|
||||
# Because an override for where to run will affect which ports to use,
|
||||
# set these up after the local overrides.
|
||||
if LETTUCE_SELENIUM_CLIENT == 'saucelabs':
|
||||
LETTUCE_SERVER_PORT = choice(PORTS)
|
||||
PORTS.remove(LETTUCE_SERVER_PORT)
|
||||
else:
|
||||
LETTUCE_SERVER_PORT = randint(1024, 65535)
|
||||
|
||||
# Set up XQueue information so that the lms will send
|
||||
# requests to a mock XQueue server running locally
|
||||
if LETTUCE_SELENIUM_CLIENT == 'saucelabs':
|
||||
XQUEUE_PORT = choice(PORTS)
|
||||
PORTS.remove(XQUEUE_PORT)
|
||||
else:
|
||||
XQUEUE_PORT = randint(1024, 65535)
|
||||
|
||||
# Configure XQueue interface to use our stub XQueue server
|
||||
XQUEUE_INTERFACE = {
|
||||
"url": "http://127.0.0.1:%d" % XQUEUE_PORT,
|
||||
"url": "http://127.0.0.1:{0:d}".format(XQUEUE_PORT),
|
||||
"django_auth": {
|
||||
"username": "lms",
|
||||
"password": "***REMOVED***"
|
||||
@@ -184,10 +172,5 @@ XQUEUE_INTERFACE = {
|
||||
"basic_auth": ('anant', 'agarwal'),
|
||||
}
|
||||
|
||||
# Set up Video information so that the lms will send
|
||||
# requests to a mock Youtube server running locally
|
||||
if LETTUCE_SELENIUM_CLIENT == 'saucelabs':
|
||||
VIDEO_PORT = choice(PORTS)
|
||||
PORTS.remove(VIDEO_PORT)
|
||||
else:
|
||||
VIDEO_PORT = randint(1024, 65535)
|
||||
# Point the URL used to test YouTube availability to our stub YouTube server
|
||||
YOUTUBE_TEST_URL = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
|
||||
@@ -911,6 +911,11 @@ BULK_EMAIL_LOG_SENT_EMAILS = False
|
||||
BULK_EMAIL_RETRY_DELAY_BETWEEN_SENDS = 0.02
|
||||
|
||||
|
||||
############################## Video ##########################################
|
||||
|
||||
# URL to test YouTube availability
|
||||
YOUTUBE_TEST_URL = 'https://gdata.youtube.com/feeds/api/videos/'
|
||||
|
||||
|
||||
################################### APPS ######################################
|
||||
INSTALLED_APPS = (
|
||||
|
||||
@@ -239,6 +239,16 @@ FILE_UPLOAD_HANDLERS = (
|
||||
'django.core.files.uploadhandler.TemporaryFileUploadHandler',
|
||||
)
|
||||
|
||||
########################### Server Ports ###################################
|
||||
|
||||
# These ports are carefully chosen so that if the browser needs to
|
||||
# access them, they will be available through the SauceLabs SSH tunnel
|
||||
LETTUCE_SERVER_PORT = 8003
|
||||
XQUEUE_PORT = 8040
|
||||
YOUTUBE_PORT = 8031
|
||||
LTI_PORT = 8765
|
||||
|
||||
|
||||
################### Make tests faster
|
||||
|
||||
#http://slacy.com/blog/2012/04/make-your-tests-faster-in-django-1-4/
|
||||
|
||||
Reference in New Issue
Block a user