Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
9f820c9e
Commit
9f820c9e
authored
6 years ago
by
Qubad786
Committed by
M. Rehan
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests
parent
981be5db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/djangoapps/contentstore/management/commands/tests/test_migrate_transcripts.py
+19
-17
19 additions, 17 deletions
...ore/management/commands/tests/test_migrate_transcripts.py
cms/djangoapps/contentstore/tasks.py
+2
-9
2 additions, 9 deletions
cms/djangoapps/contentstore/tasks.py
with
21 additions
and
26 deletions
cms/djangoapps/contentstore/management/commands/tests/test_migrate_transcripts.py
+
19
−
17
View file @
9f820c9e
...
...
@@ -217,29 +217,30 @@ class TestMigrateTranscripts(ModuleStoreTestCase):
"""
Test migrate transcripts logging and output
"""
course_id
=
unicode
(
self
.
course
.
id
)
expected_log
=
(
(
LOGGER_NAME
,
'
INFO
'
,
u
'
[Transcript
m
igration] process for course {} started. Migrating 1 videos
'
.
format
(
unicode
(
self
.
course
.
id
)
u
'
[Transcript
M
igration] process for course {} started. Migrating
transcripts from
1 videos
.
'
.
format
(
course
_
id
)),
(
LOGGER_NAME
,
'
INFO
'
,
'
[Transcript
m
igration] Migrating 2 transcripts
'
),
u
'
[Transcript
M
igration] Migrating 2 transcripts
for course {}.
'
.
format
(
course_id
)
),
(
LOGGER_NAME
,
'
INFO
'
,
'
[Transcript
m
igration] Result: Language hr transcript of video test_edx_video_id will be migrated
'
),
u
'
[Transcript
M
igration] Result: Language hr transcript of video test_edx_video_id will be migrated
'
),
(
LOGGER_NAME
,
'
INFO
'
,
'
[Transcript
m
igration] Result: Language ge transcript of video test_edx_video_id will be migrated
'
),
u
'
[Transcript
M
igration] Result: Language ge transcript of video test_edx_video_id will be migrated
'
),
(
LOGGER_NAME
,
'
INFO
'
,
u
'
[Transcript
m
igration] task submission for course {} ended.
'
.
format
(
unicode
(
self
.
course
.
id
)
u
'
[Transcript
M
igration] task submission for course {} ended.
'
.
format
(
course
_
id
)),
(
LOGGER_NAME
,
'
INFO
'
,
"
[Transcript
m
igration] Result: None
"
)
"
[Transcript
M
igration] Result: None
"
)
)
with
LogCapture
(
LOGGER_NAME
,
level
=
logging
.
INFO
)
as
logger
:
...
...
@@ -252,33 +253,34 @@ class TestMigrateTranscripts(ModuleStoreTestCase):
"""
Test migrate transcripts exception logging
"""
course_id
=
unicode
(
self
.
course_2
.
id
)
expected_log
=
(
(
LOGGER_NAME
,
'
INFO
'
,
u
'
[Transcript
m
igration] process for course {} started. Migrating 1 videos
'
.
format
(
unicode
(
self
.
course_
2
.
id
)
u
'
[Transcript
M
igration] process for course {} started. Migrating
transcripts from
1 videos
.
'
.
format
(
course_id
)),
(
LOGGER_NAME
,
'
INFO
'
,
'
[Transcript
m
igration] Migrating 1 transcripts
'
),
u
'
[Transcript
M
igration] Migrating 1 transcripts
for course {}.
'
.
format
(
course_id
)
),
(
LOGGER_NAME
,
'
INFO
'
,
u
'
[Transcript migration]
process for ge transcript started
'
),
u
'
[Transcript migration]
migration process is started for video [test_edx_video_id_2] language [ge].
'
),
(
LOGGER_NAME
,
'
ERROR
'
,
"
[Transcript migration]
Exception: u
'
No transcript for `ge`
language
'
"
),
u
"
[Transcript migration]
transcript migration failed for video [test_edx_video_id_2] and
language
[ge].
"
),
(
LOGGER_NAME
,
'
INFO
'
,
"
[Transcript
m
igration] Result: Failed: language ge of video test_edx_video_id_2 with exception
"
"
[Transcript
M
igration] Result: Failed: language ge of video test_edx_video_id_2 with exception
"
"
No transcript for `ge` language
"
),
(
LOGGER_NAME
,
'
INFO
'
,
u
'
[Transcript
m
igration] task submission for course {} ended.
'
.
format
(
unicode
(
self
.
course_
2
.
id
)
u
'
[Transcript
M
igration] task submission for course {} ended.
'
.
format
(
course_id
)),
(
LOGGER_NAME
,
'
INFO
'
,
"
[Transcript
m
igration] Result: None
"
)
"
[Transcript
M
igration] Result: None
"
)
)
with
LogCapture
(
LOGGER_NAME
,
level
=
logging
.
INFO
)
as
logger
:
...
...
This diff is collapsed.
Click to expand it.
cms/djangoapps/contentstore/tasks.py
+
2
−
9
View file @
9f820c9e
...
...
@@ -183,7 +183,7 @@ def async_migrate_transcript(self, course_key, **kwargs): # pylint: disable=un
chord
(
sub_tasks
)(
callback
)
LOGGER
.
info
(
"
[%s] t
ranscripts migration process
for course %s ended.
"
,
"
[%s] t
ask submission
for course %s ended.
"
,
MIGRATION_LOGS_PREFIX
,
course_key
)
...
...
@@ -240,8 +240,6 @@ def async_migrate_transcript_subtask(self, *args, **kwargs): # pylint: disable=
)
# Start transcript's migration
message
=
None
# Clean `edx_video_id`
edx_video_id
=
clean_video_id
(
video
.
edx_video_id
)
LOGGER
.
info
(
...
...
@@ -289,14 +287,9 @@ def async_migrate_transcript_subtask(self, *args, **kwargs): # pylint: disable=
else
:
message
=
(
'
Success: transcript (language: {language_code}, edx_video_id: {edx_video_id}) has been migrated
'
'
for video [location].
'
'
for video [
{
location
}
].
'
).
format
(
edx_video_id
=
edx_video_id
,
language_code
=
language_code
,
location
=
unicode
(
video
.
location
))
# Log to indicate that Migration has been ended.
LOGGER
.
info
(
"
[Transcript migration] migration process is ended for video [%s] language [%s].
"
,
edx_video_id
,
language_code
)
return
message
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment