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
1d9c272a
Commit
1d9c272a
authored
Aug 26, 2014
by
Calen Pennington
Committed by
Nimisha Asthagiri
Sep 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LMS-11282 Paver Lettuce Acceptance support for Split; default store set to Draft.
parent
4d362765
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
16 deletions
+33
-16
pavelib/acceptance_test.py
+8
-0
pavelib/utils/test/suites/acceptance_suite.py
+25
-16
No files found.
pavelib/acceptance_test.py
View file @
1d9c272a
...
...
@@ -19,6 +19,7 @@ __test__ = False # do not collect
)
@cmdopts
([
(
"system="
,
"s"
,
"System to act on"
),
(
"default_store="
,
"m"
,
"Default modulestore to use for course creation"
),
(
"fasttest"
,
"a"
,
"Run without collectstatic"
),
(
"extra_args="
,
"e"
,
"adds as extra args to the test command"
),
make_option
(
"--verbose"
,
action
=
"store_const"
,
const
=
2
,
dest
=
"verbosity"
),
...
...
@@ -32,6 +33,7 @@ def test_acceptance(options):
opts
=
{
'fasttest'
:
getattr
(
options
,
'fasttest'
,
False
),
'system'
:
getattr
(
options
,
'system'
,
None
),
'default_store'
:
getattr
(
options
,
'default_store'
,
None
),
'verbosity'
:
getattr
(
options
,
'verbosity'
,
3
),
'extra_args'
:
getattr
(
options
,
'extra_args'
,
''
),
}
...
...
@@ -42,6 +44,12 @@ def test_acceptance(options):
'No system specified, running tests for both cms and lms.'
)
print
(
msg
)
if
opts
[
'default_store'
]
not
in
[
'draft'
,
'split'
]:
msg
=
colorize
(
'red'
,
'No modulestore specified, running tests for both draft and split.'
)
print
(
msg
)
suite
=
AcceptanceTestSuite
(
'{} acceptance'
.
format
(
opts
[
'system'
]),
**
opts
)
suite
.
run
()
pavelib/utils/test/suites/acceptance_suite.py
View file @
1d9c272a
...
...
@@ -17,7 +17,8 @@ class AcceptanceTest(TestSuite):
super
(
AcceptanceTest
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
report_dir
=
Env
.
REPORT_DIR
/
'acceptance'
self
.
fasttest
=
kwargs
.
get
(
'fasttest'
,
False
)
self
.
system
=
kwargs
.
get
(
'system'
,
None
)
self
.
system
=
kwargs
.
get
(
'system'
)
self
.
default_store
=
kwargs
.
get
(
'default_store'
)
self
.
extra_args
=
kwargs
.
get
(
'extra_args'
,
''
)
def
__enter__
(
self
):
...
...
@@ -35,9 +36,10 @@ class AcceptanceTest(TestSuite):
report_file
=
self
.
report_dir
/
"{}.xml"
.
format
(
self
.
system
)
report_args
=
"--with-xunit --xunit-file {}"
.
format
(
report_file
)
cmd
=
(
"./manage.py {system} --settings acceptance harvest --traceback "
cmd
=
(
"
DEFAULT_STORE={default_store}
./manage.py {system} --settings acceptance harvest --traceback "
"--debug-mode --verbosity {verbosity} {report_args} {extra_args}"
.
format
(
default_store
=
self
.
default_store
,
system
=
self
.
system
,
verbosity
=
self
.
verbosity
,
report_args
=
report_args
,
...
...
@@ -65,24 +67,31 @@ class AcceptanceTestSuite(TestSuite):
self
.
root
=
'acceptance'
self
.
db
=
Env
.
REPO_ROOT
/
'test_root/db/test_edx.db'
self
.
db_cache
=
Env
.
REPO_ROOT
/
'common/test/db_cache/lettuce.db'
self
.
system
=
kwargs
.
get
(
'system'
,
None
)
self
.
fasttest
=
kwargs
.
get
(
'fasttest'
,
False
)
if
self
.
system
:
self
.
subsuites
=
[
AcceptanceTest
(
'{} acceptance'
.
format
(
self
.
system
),
**
kwargs
),
]
if
kwargs
.
get
(
'system'
):
systems
=
[
kwargs
[
'system'
]]
else
:
kwargs
[
'system'
]
=
'lms'
lms
=
AcceptanceTest
(
'lms acceptance'
,
**
kwargs
)
kwargs
[
'system'
]
=
'cms'
cms
=
AcceptanceTest
(
'cms acceptance'
,
**
kwargs
)
self
.
subsuites
=
[
lms
,
cms
]
systems
=
[
'lms'
,
'cms'
]
if
kwargs
.
get
(
'default_store'
):
stores
=
[
kwargs
[
'default_store'
]]
else
:
# TODO fix Acceptance tests with Split (LMS-11300)
# stores = ['split', 'draft']
stores
=
[
'draft'
]
self
.
subsuites
=
[]
for
system
in
systems
:
for
default_store
in
stores
:
kwargs
[
'system'
]
=
system
kwargs
[
'default_store'
]
=
default_store
self
.
subsuites
.
append
(
AcceptanceTest
(
'{} acceptance using {}'
.
format
(
system
,
default_store
),
**
kwargs
))
def
__enter__
(
self
):
super
(
AcceptanceTestSuite
,
self
)
.
__enter__
()
test_utils
.
clean_test_files
()
test_utils
.
clean_test_files
()
if
not
self
.
fasttest
:
self
.
_setup_acceptance_db
()
...
...
@@ -104,7 +113,7 @@ class AcceptanceTestSuite(TestSuite):
if
self
.
db
.
isfile
():
# Since we are using SQLLite, we can reset the database by deleting it on disk.
self
.
db
.
remove
()
if
self
.
db_cache
.
isfile
():
# To speed up migrations, we check for a cached database file and start from that.
# The cached database file should be checked into the repo
...
...
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