-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check YouTube Availability for Video Tests #3882
Conversation
By default we will check the availability of below But to check an extra URL, use the below statement right above a @check_youtube(your URL here) There is any issue with transcript API URL(video.google.com/timedtext), if we HTTP GET this URL we will always get status_code = 404, so we have to use the URL like below explicitly mentioning video id for which we want transcript So question is what is the Best way to handle the above? |
urls = ['https://youtube.com', 'http://www.youtube.com/iframe_api', 'http://gdata.youtube.com/feeds/api/videos/'] | ||
|
||
# Check if tag is present | ||
tag = [tag for tag in scenario.tags if tag.startswith('check_youtube')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are scenario tags set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in
- cms/djangoapps/contentstore/features/video.py
- lms/djangoapps/courseware/features/video.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tags are just test decorators, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
@muhammad-ammar that's ok to ask for "http://video.google.com/timedtext?lang=en&v=OEoXaMPEzfM" with specific video in the link. Default video is fine. |
I think that we can add "http://video.google.com/timedtext?lang=en&v=OEoXaMPEzfM" to list of all urls that need to be checked. |
urls.extend(match.group(1).split(',')) | ||
|
||
if not is_urls_available(urls): | ||
# This is a hakish way to skip a test in lettuce as there is no proper way to skip a test conditionally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: hakish
looks good 👍 |
I am not sure about this. @polesye What is your opinion? |
@muhammad-ammar I think it's good idea. It will be enough to check server availability. |
# Here we are adding query parameters for a specific transcript, we are doing this because without query parameters, | ||
# the GET request will always return 404 whether the YouTube is available or not. | ||
# TODO: What should be the URL to check_youtube? | ||
@check_youtube(http://video.google.com/timedtext?lang=en&v=OEoXaMPEzfM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer rename it so check_youtube
-> is_youtube_available
or skip_if_youtube_unavailable
I am little bit confused. Now i have added My Question is SHOULD we check the
If we go with the second way then we only need to place the |
First.
I don't think so. |
@polesye cool. That would make things simple. |
@@ -23,6 +23,11 @@ | |||
DELAY = 0.5 | |||
|
|||
|
|||
@before.each_scenario |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't do what you want. Once this file is loaded the method will be run before every scenario that is executed, not just the video ones. http://lettuce.it/reference/terrain.html#lettuce-hooks
Do we have similar solution for the bok-choy tests? |
For now there is nothing. After this PR is completed we will provide a solution for bok-choy tests. |
|
||
""" | ||
for tag in scenario.tags: | ||
print tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accidentally left this in from debugging
👍 |
👍 |
Check YouTube Availability for Video Tests
Check if YouTube is available before running a Video Test.