Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
3137d969
Commit
3137d969
authored
Dec 04, 2017
by
Stuart Young
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
paver command to update bokchoy db cache
parent
fab7f31a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletions
+49
-1
pavelib/__init__.py
+4
-1
pavelib/database.py
+45
-0
No files found.
pavelib/__init__.py
View file @
3137d969
"""
paver commands
"""
from
.
import
assets
,
servers
,
docs
,
prereqs
,
quality
,
tests
,
js_test
,
i18n
,
bok_choy
,
acceptance_test
from
.
import
(
assets
,
servers
,
docs
,
prereqs
,
quality
,
tests
,
js_test
,
i18n
,
bok_choy
,
acceptance_test
,
database
)
pavelib/database.py
0 → 100644
View file @
3137d969
"""
tasks for controlling the databases used in tests
"""
from
__future__
import
print_function
import
os
from
paver.easy
import
sh
,
needs
from
pavelib.utils.passthrough_opts
import
PassthroughTask
from
pavelib.utils.timer
import
timed
from
pavelib.utils.envs
import
Env
@needs
(
'pavelib.prereqs.install_prereqs'
)
@PassthroughTask
@timed
def
update_bokchoy_db_cache
():
"""
Update and cache the MYSQL database for bokchoy testing. This command
will remove any previously cached database files and apply migrations
on a fresh db.
You can commit the resulting files in common/test/db_cache into
git to speed up test runs
"""
bokchoy_db_files
=
[
'bok_choy_data_default.json'
,
'bok_choy_data_student_module_history.json'
,
'bok_choy_migrations_data_default.sql'
,
'bok_choy_migrations_data_student_module_history.sql'
,
'bok_choy_schema_default.sql'
,
'bok_choy_schema_student_module_history.sql'
]
print
(
'Removing cached db files for bokchoy tests'
)
for
db_file
in
bokchoy_db_files
:
try
:
db_file_path
=
os
.
path
.
join
(
'{}/common/test/db_cache'
.
format
(
Env
.
REPO_ROOT
),
db_file
)
os
.
remove
(
db_file_path
)
print
(
'
\t
Removed {}'
.
format
(
db_file_path
))
except
OSError
:
continue
sh
(
'{}/scripts/reset-test-db.sh'
.
format
(
Env
.
REPO_ROOT
))
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