Increase the yttimeout to un-skip the video tests.
This commit is contained in:
@@ -132,6 +132,7 @@ except ImportError:
|
||||
YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['METADATA_URL'] = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEST_TIMEOUT'] = 1500
|
||||
|
||||
# Generate a random UUID so that different runs of acceptance tests don't break each other
|
||||
import uuid
|
||||
|
||||
@@ -103,6 +103,7 @@ FEATURES['ENABLE_SPECIAL_EXAMS'] = True
|
||||
|
||||
# Point the URL used to test YouTube availability to our stub YouTube server
|
||||
YOUTUBE_PORT = 9080
|
||||
YOUTUBE['TEST_TIMEOUT'] = 5000
|
||||
YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['METADATA_URL'] = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
||||
|
||||
@@ -780,6 +780,8 @@ YOUTUBE = {
|
||||
# YouTube JavaScript API
|
||||
'API': 'https://www.youtube.com/iframe_api',
|
||||
|
||||
'TEST_TIMEOUT': 1500,
|
||||
|
||||
# URL to get YouTube metadata
|
||||
'METADATA_URL': 'https://www.googleapis.com/youtube/v3/videos',
|
||||
|
||||
|
||||
@@ -315,11 +315,7 @@ class VideoModule(VideoFields, VideoTranscriptsMixin, VideoStudentViewHandlers,
|
||||
'end': self.end_time.total_seconds(),
|
||||
'transcriptLanguage': transcript_language,
|
||||
'transcriptLanguages': sorted_languages,
|
||||
|
||||
# TODO: Later on the value 1500 should be taken from some global
|
||||
# configuration setting field.
|
||||
'ytTestTimeout': 1500,
|
||||
|
||||
'ytTestTimeout': settings.YOUTUBE['TEST_TIMEOUT'],
|
||||
'ytApiUrl': settings.YOUTUBE['API'],
|
||||
'ytMetadataUrl': settings.YOUTUBE['METADATA_URL'],
|
||||
'ytKey': yt_api_key,
|
||||
|
||||
@@ -69,12 +69,28 @@ def is_youtube_available():
|
||||
bool:
|
||||
|
||||
"""
|
||||
# Skip all the youtube tests for now because they are failing intermittently
|
||||
# due to changes on their side. See: TE-1927
|
||||
# TODO: Design and implement a better solution that is reliable and repeatable,
|
||||
# reflects how the application works in production, and limits the third-party
|
||||
# network traffic (e.g. repeatedly retrieving the js from youtube from the browser).
|
||||
return False
|
||||
|
||||
youtube_api_urls = {
|
||||
'main': 'https://www.youtube.com/',
|
||||
'player': 'https://www.youtube.com/iframe_api',
|
||||
# For transcripts, you need to check an actual video, so we will
|
||||
# just specify our default video and see if that one is available.
|
||||
'transcript': 'http://video.google.com/timedtext?lang=en&v=3_yD_cEKoCk',
|
||||
}
|
||||
|
||||
for url in youtube_api_urls.itervalues():
|
||||
try:
|
||||
response = requests.get(url, allow_redirects=False)
|
||||
except requests.exceptions.ConnectionError:
|
||||
return False
|
||||
|
||||
if response.status_code >= 300:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def is_focused_on_element(browser, selector):
|
||||
|
||||
@@ -412,7 +412,7 @@ class YouTubeVideoTest(VideoBaseTest):
|
||||
Then the video has rendered in "HTML5" mode
|
||||
"""
|
||||
# configure youtube server
|
||||
self.youtube_configuration['time_to_response'] = 2.0
|
||||
self.youtube_configuration['time_to_response'] = 7.0
|
||||
self.metadata = self.metadata_for_mode('youtube_html5')
|
||||
|
||||
self.navigate_to_video()
|
||||
|
||||
@@ -188,6 +188,7 @@ XQUEUE_INTERFACE = {
|
||||
YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['METADATA_URL'] = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEST_TIMEOUT'] = 1500
|
||||
|
||||
if FEATURES.get('ENABLE_COURSEWARE_SEARCH') or \
|
||||
FEATURES.get('ENABLE_DASHBOARD_SEARCH') or \
|
||||
|
||||
@@ -153,6 +153,7 @@ FEATURES['ENABLE_SPECIAL_EXAMS'] = True
|
||||
|
||||
# Point the URL used to test YouTube availability to our stub YouTube server
|
||||
YOUTUBE_PORT = 9080
|
||||
YOUTUBE['TEST_TIMEOUT'] = 5000
|
||||
YOUTUBE['API'] = "http://127.0.0.1:{0}/get_youtube_api/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['METADATA_URL'] = "http://127.0.0.1:{0}/test_youtube/".format(YOUTUBE_PORT)
|
||||
YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YOUTUBE_PORT)
|
||||
|
||||
@@ -1885,6 +1885,8 @@ YOUTUBE = {
|
||||
# YouTube JavaScript API
|
||||
'API': 'https://www.youtube.com/iframe_api',
|
||||
|
||||
'TEST_TIMEOUT': 1500,
|
||||
|
||||
# URL to get YouTube metadata
|
||||
'METADATA_URL': 'https://www.googleapis.com/youtube/v3/videos/',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user