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
b14553d8
Commit
b14553d8
authored
Jun 25, 2013
by
Jonah Stanley
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #220 from edx/jonahstanley/make-units-parallel
Jonahstanley/make units parallel
parents
397583e1
8a9125f1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
16 deletions
+29
-16
cms/djangoapps/contentstore/tests/test_contentstore.py
+22
-9
cms/envs/test.py
+1
-1
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+1
-0
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
+4
-2
jenkins/test.sh
+0
-3
rakelib/tests.rake
+1
-1
No files found.
cms/djangoapps/contentstore/tests/test_contentstore.py
View file @
b14553d8
...
...
@@ -23,7 +23,7 @@ from xmodule.modulestore import Location
from
xmodule.modulestore.store_utilities
import
clone_course
from
xmodule.modulestore.store_utilities
import
delete_course
from
xmodule.modulestore.django
import
modulestore
from
xmodule.contentstore.django
import
contentstore
from
xmodule.contentstore.django
import
contentstore
,
_CONTENTSTORE
from
xmodule.templates
import
update_templates
from
xmodule.modulestore.xml_exporter
import
export_to_xml
from
xmodule.modulestore.xml_importer
import
import_from_xml
,
perform_xlint
...
...
@@ -43,10 +43,12 @@ from django_comment_common.utils import are_permissions_roles_seeded
from
xmodule.exceptions
import
InvalidVersionError
import
datetime
from
pytz
import
UTC
from
uuid
import
uuid4
from
pymongo
import
MongoClient
TEST_DATA_MODULESTORE
=
copy
.
deepcopy
(
settings
.
MODULESTORE
)
TEST_DATA_
MODULESTORE
[
'default'
][
'OPTIONS'
][
'fs_root'
]
=
path
(
'common/test/data'
)
TEST_DATA_
MODULESTORE
[
'direct'
][
'OPTIONS'
][
'fs_root'
]
=
path
(
'common/test/data'
)
TEST_DATA_
CONTENTSTORE
=
copy
.
deepcopy
(
settings
.
CONTENTSTORE
)
TEST_DATA_
CONTENTSTORE
[
'OPTIONS'
][
'db'
]
=
'test_xcontent_
%
s'
%
uuid4
()
.
hex
class
MongoCollectionFindWrapper
(
object
):
...
...
@@ -59,13 +61,16 @@ class MongoCollectionFindWrapper(object):
return
self
.
original
(
query
,
*
args
,
**
kwargs
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MODULE
STORE
)
@override_settings
(
CONTENTSTORE
=
TEST_DATA_CONTENT
STORE
)
class
ContentStoreToyCourseTest
(
ModuleStoreTestCase
):
"""
Tests that rely on the toy courses.
TODO: refactor using CourseFactory so they do not.
"""
def
setUp
(
self
):
settings
.
MODULESTORE
[
'default'
][
'OPTIONS'
][
'fs_root'
]
=
path
(
'common/test/data'
)
settings
.
MODULESTORE
[
'direct'
][
'OPTIONS'
][
'fs_root'
]
=
path
(
'common/test/data'
)
uname
=
'testuser'
email
=
'test+courses@edx.org'
password
=
'foo'
...
...
@@ -83,6 +88,11 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
self
.
client
=
Client
()
self
.
client
.
login
(
username
=
uname
,
password
=
password
)
def
tearDown
(
self
):
mongo
=
MongoClient
()
mongo
.
drop_database
(
TEST_DATA_CONTENTSTORE
[
'OPTIONS'
][
'db'
])
_CONTENTSTORE
.
clear
()
def
check_components_on_page
(
self
,
component_types
,
expected_types
):
"""
Ensure that the right types end up on the page.
...
...
@@ -403,7 +413,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
self
.
assertGreater
(
len
(
all_assets
),
0
)
# make sure we have some thumbnails in our contentstore
all_thumbnails
=
content_store
.
get_all_content_thumbnails_for_course
(
course_location
)
content_store
.
get_all_content_thumbnails_for_course
(
course_location
)
#
# cdodge: temporarily comment out assertion on thumbnails because many environments
...
...
@@ -442,7 +452,6 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
content_store
=
contentstore
()
trash_store
=
contentstore
(
'trashcan'
)
module_store
=
modulestore
(
'direct'
)
import_from_xml
(
module_store
,
'common/test/data/'
,
[
'full'
],
static_content_store
=
content_store
)
# look up original (and thumbnail) in content store, should be there after import
...
...
@@ -533,7 +542,6 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
all_assets
=
trash_store
.
get_all_content_for_course
(
course_location
)
self
.
assertEqual
(
len
(
all_assets
),
0
)
all_thumbnails
=
trash_store
.
get_all_content_thumbnails_for_course
(
course_location
)
self
.
assertEqual
(
len
(
all_thumbnails
),
0
)
...
...
@@ -598,7 +606,6 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
self
.
assertRaises
(
InvalidVersionError
,
draft_store
.
unpublish
,
location
)
def
test_bad_contentstore_request
(
self
):
resp
=
self
.
client
.
get
(
'http://localhost:8001/c4x/CDX/123123/asset/&images_circuits_Lab7Solution2.png'
)
self
.
assertEqual
(
resp
.
status_code
,
400
)
...
...
@@ -809,6 +816,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
export_to_xml
(
module_store
,
content_store
,
location
,
root_dir
,
'test_export'
)
@override_settings
(
CONTENTSTORE
=
TEST_DATA_CONTENTSTORE
)
class
ContentStoreTest
(
ModuleStoreTestCase
):
"""
Tests for the CMS ContentStore application.
...
...
@@ -845,6 +853,11 @@ class ContentStoreTest(ModuleStoreTestCase):
'display_name'
:
'Robot Super Course'
,
}
def
tearDown
(
self
):
mongo
=
MongoClient
()
mongo
.
drop_database
(
TEST_DATA_CONTENTSTORE
[
'OPTIONS'
][
'db'
])
_CONTENTSTORE
.
clear
()
def
test_create_course
(
self
):
"""Test new course creation - happy path"""
resp
=
self
.
client
.
post
(
reverse
(
'create_new_course'
),
self
.
course_data
)
...
...
cms/envs/test.py
View file @
b14553d8
...
...
@@ -70,7 +70,7 @@ CONTENTSTORE = {
'ENGINE'
:
'xmodule.contentstore.mongo.MongoContentStore'
,
'OPTIONS'
:
{
'host'
:
'localhost'
,
'db'
:
'test_x
module
'
,
'db'
:
'test_x
content
'
,
},
# allow for additional options that can be keyed on a name, e.g. 'trashcan'
'ADDITIONAL_OPTIONS'
:
{
...
...
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
View file @
b14553d8
...
...
@@ -27,6 +27,7 @@ class ModuleStoreTestCase(TestCase):
# Remove everything except templates
modulestore
.
collection
.
remove
(
query
)
modulestore
.
collection
.
drop
()
@staticmethod
def
load_templates_if_necessary
():
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py
View file @
b14553d8
...
...
@@ -13,11 +13,12 @@ from xmodule.templates import update_templates
from
.test_modulestore
import
check_path_to_location
from
.
import
DATA_DIR
from
uuid
import
uuid4
HOST
=
'localhost'
PORT
=
27017
DB
=
'test
'
DB
=
'test
_mongo_
%
s'
%
uuid4
()
.
hex
COLLECTION
=
'modulestore'
FS_ROOT
=
DATA_DIR
# TODO (vshnayder): will need a real fs_root for testing load_item
DEFAULT_CLASS
=
'xmodule.raw_module.RawDescriptor'
...
...
@@ -39,7 +40,8 @@ class TestMongoModuleStore(object):
@classmethod
def
teardownClass
(
cls
):
pass
cls
.
connection
=
pymongo
.
connection
.
Connection
(
HOST
,
PORT
)
cls
.
connection
.
drop_database
(
DB
)
@staticmethod
def
initdb
():
...
...
jenkins/test.sh
View file @
b14553d8
...
...
@@ -60,9 +60,6 @@ fi
export
PIP_DOWNLOAD_CACHE
=
/mnt/pip-cache
# Allow django liveserver tests to use a range of ports
export
DJANGO_LIVE_TEST_SERVER_ADDRESS
=
${
DJANGO_LIVE_TEST_SERVER_ADDRESS
-localhost
:8000-9000
}
source
/mnt/virtualenvs/
"
$JOB_NAME
"
/bin/activate
bundle install
...
...
rakelib/tests.rake
View file @
b14553d8
...
...
@@ -16,7 +16,7 @@ def run_tests(system, report_dir, test_id=nil, stop_on_failure=true)
ENV
[
'NOSE_XUNIT_FILE'
]
=
File
.
join
(
report_dir
,
"nosetests.xml"
)
dirs
=
Dir
[
"common/djangoapps/*"
]
+
Dir
[
"
#{
system
}
/djangoapps/*"
]
test_id
=
dirs
.
join
(
' '
)
if
test_id
.
nil?
or
test_id
==
''
cmd
=
django_admin
(
system
,
:test
,
'test'
,
'--logging-clear-handlers'
,
test_id
)
cmd
=
django_admin
(
system
,
:test
,
'test'
,
'--logging-clear-handlers'
,
'--liveserver=localhost:8000-9000'
,
test_id
)
test_sh
(
run_under_coverage
(
cmd
,
system
))
end
...
...
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