Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-video-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-video-pipeline
Commits
b059bd35
Commit
b059bd35
authored
Sep 14, 2017
by
muzaffaryousaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing/Refactoring tests to get green build.
parent
6f9ad5c3
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
41 deletions
+50
-41
control/celeryapp.py
+12
-14
control/tests/test_encode.py
+1
-1
control/tests/test_heal.py
+6
-10
control/tests/test_val.py
+1
-12
control/veda_heal.py
+2
-1
control/veda_video_validation.py
+8
-3
test_config.yaml
+20
-0
No files found.
control/celeryapp.py
View file @
b059bd35
"""
Start Celery Worker
"""
from
__future__
import
absolute_import
import
os
from
celery
import
Celery
import
yaml
"""
Start Celery Worker
"""
try
:
from
control.control_env
import
*
except
:
from
control_env
import
*
from
control.veda_deliver
import
VedaDelivery
try
:
from
control.veda_deliver
import
VedaDelivery
except
:
from
veda_deliver
import
VedaDelivery
auth_yaml
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))),
...
...
@@ -48,6 +43,7 @@ app.conf.update(
CELERY_ACCEPT_CONTENT
=
[
'pickle'
,
'json'
,
'msgpack'
,
'yaml'
]
)
@app.task
(
name
=
'worker_encode'
)
def
worker_task_fire
(
veda_id
,
encode_profile
,
jobid
):
pass
...
...
@@ -55,12 +51,14 @@ def worker_task_fire(veda_id, encode_profile, jobid):
@app.task
(
name
=
'supervisor_deliver'
)
def
deliverable_route
(
veda_id
,
encode_profile
):
VD
=
VedaDelivery
(
"""
Task for deliverable route.
"""
veda_deliver
=
VedaDelivery
(
veda_id
=
veda_id
,
encode_profile
=
encode_profile
)
VD
.
run
()
veda_deliver
.
run
()
@app.task
...
...
control/tests/test_encode.py
View file @
b059bd35
...
...
@@ -63,7 +63,7 @@ class TestEncode(TestCase):
)
.
delete
()
encode_list
=
self
.
E
.
determine_encodes
()
baseline
=
len
(
encode_list
)
self
.
assertTrue
(
isinstance
(
encode_list
,
lis
t
))
self
.
assertTrue
(
isinstance
(
encode_list
,
se
t
))
self
.
E
.
encode_list
=
set
()
url
=
URL
(
...
...
control/tests/test_heal.py
View file @
b059bd35
...
...
@@ -8,11 +8,10 @@ import sys
from
django.test
import
TestCase
from
datetime
import
timedelta
from
ddt
import
data
,
ddt
,
unpack
from
py
test
import
skip
from
unit
test
import
skip
import
responses
from
django.utils.timezone
import
utc
from
mock
import
PropertyMock
,
patch
import
yaml
from
control.veda_heal
import
VedaHeal
from
VEDA_OS01.models
import
URL
,
Course
,
Destination
,
Encode
,
Video
...
...
@@ -24,6 +23,7 @@ sys.path.append(os.path.dirname(os.path.dirname(
CONFIG_DATA
=
get_config
(
'test_config.yaml'
)
@ddt
class
HealTests
(
TestCase
):
"""
...
...
@@ -32,15 +32,11 @@ class HealTests(TestCase):
def
setUp
(
self
):
self
.
heal_instance
=
VedaHeal
()
self
.
auth_yaml
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))),
'instance_config.yaml'
)
self
.
encode_list
=
set
()
with
open
(
self
.
auth_yaml
,
'r'
)
as
stream
:
for
key
,
entry
in
yaml
.
load
(
stream
)
[
'encode_dict'
]
.
items
():
for
e
in
entry
:
self
.
encode_list
.
add
(
e
)
for
key
,
entry
in
CONFIG_DATA
[
'encode_dict'
]
.
items
():
for
e
in
entry
:
self
.
encode_list
.
add
(
e
)
self
.
video_id
=
'12345'
self
.
course_object
=
Course
.
objects
.
create
(
...
...
control/tests/test_val.py
View file @
b059bd35
...
...
@@ -39,16 +39,9 @@ class TestVALAPI(TestCase):
val_status
=
'complete'
)
self
.
auth_yaml
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))),
'instance_config.yaml'
)
self
.
auth_yaml
=
CONFIG_DATA
def
test_val_setup
(
self
):
if
not
os
.
path
.
exists
(
self
.
auth_yaml
):
self
.
assertTrue
(
self
.
VAC
.
auth_dict
is
None
)
return
None
# register val url to send api response
responses
.
add
(
responses
.
POST
,
CONFIG_DATA
[
'val_token_url'
],
'{"access_token": "1234567890"}'
,
status
=
200
)
...
...
@@ -65,10 +58,6 @@ class TestVALAPI(TestCase):
@responses.activate
def
test_val_connection
(
self
):
if
not
os
.
path
.
exists
(
self
.
auth_yaml
):
self
.
assertTrue
(
self
.
VAC
.
auth_dict
is
None
)
return
None
# register val url to send api response
responses
.
add
(
responses
.
POST
,
CONFIG_DATA
[
'val_token_url'
],
'{"access_token": "1234567890"}'
,
status
=
200
)
responses
.
add
(
responses
.
GET
,
CONFIG_DATA
[
'val_api_url'
],
status
=
200
)
...
...
control/veda_heal.py
View file @
b059bd35
...
...
@@ -119,7 +119,8 @@ class VedaHeal(object):
course_object
=
video_object
.
inst_class
,
)
.
determine_encodes
()
try
:
uncompleted_encodes
.
remove
(
'review'
)
if
uncompleted_encodes
:
uncompleted_encodes
.
remove
(
'review'
)
except
ValueError
:
pass
...
...
control/veda_video_validation.py
View file @
b059bd35
...
...
@@ -5,6 +5,9 @@ import subprocess
import
fnmatch
import
django
from
control.control_env
import
FFPROBE
from
VEDA_OS01.models
import
Video
"""
VEDA Intake/Product Final Testing Suite
...
...
@@ -15,10 +18,9 @@ image files (which read as 0:00 duration or N/A)
Mismatched Durations (within 5 sec)
"""
from
control_env
import
*
class
Validation
():
class
Validation
(
object
):
"""
Expects a full filepath
"""
...
...
@@ -43,7 +45,6 @@ class Validation():
FFPROBE
,
"
\"
"
+
self
.
videofile
+
"
\"
"
))
"""
Test if size is zero
"""
...
...
@@ -61,6 +62,10 @@ class Validation():
if
"multiple edit list entries, a/v desync might occur, patch welcome"
in
line
:
return
False
if
"command not found"
in
line
:
print
line
return
False
if
"Duration: "
in
line
:
if
"Duration: 00:00:00.0"
in
line
:
return
False
...
...
test_config.yaml
View file @
b059bd35
...
...
@@ -27,6 +27,26 @@ val_username: username
val_transcript_create_url
:
http://val.edx.org/transcript/create
val_video_transcript_status_url
:
http://val.edx.org/video/status
# ----------
##---
# This is a list of encodes and their respective course
# boolean matches
encode_dict
:
review_proc
:
-
review
mobile_override
:
-
override
s3_proc
:
-
mobile_high
-
mobile_low
-
audio_mp3
-
desktop_webm
-
desktop_mp4
-
hls
yt_proc
:
-
youtube
# This is a list of encode profiles and their val profile matches
# boolean matches
val_profile_dict
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment