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
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
099ce130
Commit
099ce130
authored
8 years ago
by
Calen Pennington
Browse files
Options
Downloads
Patches
Plain Diff
Re-generate the modulestore collection names for every test
parent
dced13a8
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+13
-10
13 additions, 10 deletions
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
lms/envs/test.py
+2
-2
2 additions, 2 deletions
lms/envs/test.py
with
15 additions
and
12 deletions
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+
13
−
10
View file @
099ce130
...
...
@@ -93,8 +93,8 @@ def draft_mongo_store_config(data_dir):
'
DOC_STORE_CONFIG
'
:
{
'
host
'
:
MONGO_HOST
,
'
port
'
:
MONGO_PORT_NUM
,
'
db
'
:
'
test_xmodule
'
,
'
collection
'
:
'
modulestore
_{0}
'
.
format
(
uuid4
().
hex
[:
5
])
,
'
db
'
:
'
test_xmodule
_{}
'
.
format
(
uuid4
().
hex
)
,
'
collection
'
:
'
modulestore
'
,
},
'
OPTIONS
'
:
modulestore_options
}
...
...
@@ -120,8 +120,8 @@ def split_mongo_store_config(data_dir):
'
DOC_STORE_CONFIG
'
:
{
'
host
'
:
MONGO_HOST
,
'
port
'
:
MONGO_PORT_NUM
,
'
db
'
:
'
test_xmodule
'
,
'
collection
'
:
'
modulestore
_{0}
'
.
format
(
uuid4
().
hex
[:
5
])
,
'
db
'
:
'
test_xmodule
_{}
'
.
format
(
uuid4
().
hex
)
,
'
collection
'
:
'
modulestore
'
,
},
'
OPTIONS
'
:
modulestore_options
}
...
...
@@ -154,17 +154,20 @@ TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
# test course into this modulestore.
# If your test needs a graded course to test against, import the common/test/data/graded
# test course into this modulestore.
TEST_DATA_MIXED_MODULESTORE
=
mixed_store_config
(
TEST_DATA_DIR
,
{}
TEST_DATA_MIXED_MODULESTORE
=
functools
.
partial
(
mixed_store_config
,
TEST_DATA_DIR
,
{}
)
# All store requests now go through mixed
# Use this modulestore if you specifically want to test mongo and not a mocked modulestore.
TEST_DATA_MONGO_MODULESTORE
=
mixed_store_config
(
mkdtemp_clean
(),
{})
TEST_DATA_MONGO_MODULESTORE
=
functools
.
partial
(
mixed_store_config
,
mkdtemp_clean
(),
{})
# All store requests now go through mixed
# Use this modulestore if you specifically want to test split-mongo and not a mocked modulestore.
TEST_DATA_SPLIT_MODULESTORE
=
mixed_store_config
(
TEST_DATA_SPLIT_MODULESTORE
=
functools
.
partial
(
mixed_store_config
,
mkdtemp_clean
(),
{},
store_order
=
[
StoreConstructors
.
split
,
StoreConstructors
.
draft
]
...
...
@@ -191,7 +194,7 @@ class ModuleStoreIsolationMixin(CacheIsolationMixin):
"""
MODULESTORE
=
mixed_store_config
(
mkdtemp_clean
(),
{})
MODULESTORE
=
functools
.
partial
(
mixed_store_config
,
mkdtemp_clean
(),
{})
ENABLED_CACHES
=
[
'
mongo_metadata_inheritance
'
,
'
loc_cache
'
]
__settings_overrides
=
[]
__old_modulestores
=
[]
...
...
@@ -205,7 +208,7 @@ class ModuleStoreIsolationMixin(CacheIsolationMixin):
"""
cls
.
start_cache_isolation
()
override
=
override_settings
(
MODULESTORE
=
cls
.
MODULESTORE
,
MODULESTORE
=
cls
.
MODULESTORE
()
,
)
cls
.
__old_modulestores
.
append
(
copy
.
deepcopy
(
settings
.
MODULESTORE
))
...
...
This diff is collapsed.
Click to expand it.
lms/envs/test.py
+
2
−
2
View file @
099ce130
...
...
@@ -164,8 +164,8 @@ update_module_store_settings(
doc_store_settings
=
{
'
host
'
:
MONGO_HOST
,
'
port
'
:
MONGO_PORT_NUM
,
'
db
'
:
'
test_xmodule
'
,
'
collection
'
:
'
test_modulestore
{0}
'
.
format
(
THIS_UUID
)
,
'
db
'
:
'
test_xmodule
_{}
'
.
format
(
THIS_UUID
)
,
'
collection
'
:
'
test_modulestore
'
,
},
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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