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
dcefd9e9
Commit
dcefd9e9
authored
May 20, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Taught rake test_lms and test_cms to run specific tests by passing a single argument
parent
2add58bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
doc/testing.md
+2
-3
jenkins/test.sh
+2
-2
rakefiles/tests.rake
+8
-7
No files found.
doc/testing.md
View file @
dcefd9e9
...
@@ -117,12 +117,11 @@ xmodule can be tested independently, with this:
...
@@ -117,12 +117,11 @@ xmodule can be tested independently, with this:
To run a single django test class:
To run a single django test class:
django-admin.py test --settings=lms.envs.test --pythonpath=. lms/djangoapps/courseware/tests/tests.py:TestViewAuth
rake test_lms[courseware.tests.tests:testViewAuth]
To run a single django test:
To run a single django test:
django-admin.py test --settings=lms.envs.test --pythonpath=. lms/djangoapps/courseware/tests/tests.py:TestViewAuth.test_dark_launch
rake test_lms[courseware.tests.tests:TestViewAuth.test_dark_launch]
To run a single nose test file:
To run a single nose test file:
...
...
jenkins/test.sh
View file @
dcefd9e9
...
@@ -73,8 +73,8 @@ rake pylint > pylint.log || cat pylint.log
...
@@ -73,8 +73,8 @@ rake pylint > pylint.log || cat pylint.log
TESTS_FAILED
=
0
TESTS_FAILED
=
0
# Run the python unit tests
# Run the python unit tests
rake test_cms
[false]
||
TESTS_FAILED
=
1
rake test_cms
||
TESTS_FAILED
=
1
rake test_lms
[false]
||
TESTS_FAILED
=
1
rake test_lms
||
TESTS_FAILED
=
1
rake test_common/lib/capa
||
TESTS_FAILED
=
1
rake test_common/lib/capa
||
TESTS_FAILED
=
1
rake test_common/lib/xmodule
||
TESTS_FAILED
=
1
rake test_common/lib/xmodule
||
TESTS_FAILED
=
1
...
...
rakefiles/tests.rake
View file @
dcefd9e9
...
@@ -12,10 +12,11 @@ def run_under_coverage(cmd, root)
...
@@ -12,10 +12,11 @@ def run_under_coverage(cmd, root)
return
cmd
return
cmd
end
end
def
run_tests
(
system
,
report_dir
,
stop_on_failure
=
true
)
def
run_tests
(
system
,
report_dir
,
test_id
=
nil
,
stop_on_failure
=
true
)
ENV
[
'NOSE_XUNIT_FILE'
]
=
File
.
join
(
report_dir
,
"nosetests.xml"
)
ENV
[
'NOSE_XUNIT_FILE'
]
=
File
.
join
(
report_dir
,
"nosetests.xml"
)
dirs
=
Dir
[
"common/djangoapps/*"
]
+
Dir
[
"
#{
system
}
/djangoapps/*"
]
dirs
=
Dir
[
"common/djangoapps/*"
]
+
Dir
[
"
#{
system
}
/djangoapps/*"
]
cmd
=
django_admin
(
system
,
:test
,
'test'
,
'--logging-clear-handlers'
,
*
dirs
.
each
)
test_id
=
dirs
.
join
(
' '
)
if
test_id
.
nil?
or
test_id
==
''
cmd
=
django_admin
(
system
,
:test
,
'test'
,
'--logging-clear-handlers'
,
test_id
)
sh
(
run_under_coverage
(
cmd
,
system
))
do
|
ok
,
res
|
sh
(
run_under_coverage
(
cmd
,
system
))
do
|
ok
,
res
|
if
!
ok
and
stop_on_failure
if
!
ok
and
stop_on_failure
abort
"Test failed!"
abort
"Test failed!"
...
@@ -44,13 +45,13 @@ TEST_TASK_DIRS = []
...
@@ -44,13 +45,13 @@ TEST_TASK_DIRS = []
# Per System tasks
# Per System tasks
desc
"Run all django tests on our djangoapps for the
#{
system
}
"
desc
"Run all django tests on our djangoapps for the
#{
system
}
"
task
"test_
#{
system
}
"
,
[
:stop_on_failure
]
=>
[
"clean_test_files"
,
:predjango
,
"
#{
system
}
:gather_assets:test"
,
"fasttest_
#{
system
}
"
]
task
"test_
#{
system
}
"
,
[
:
test_id
,
:
stop_on_failure
]
=>
[
"clean_test_files"
,
:predjango
,
"
#{
system
}
:gather_assets:test"
,
"fasttest_
#{
system
}
"
]
# Have a way to run the tests without running collectstatic -- useful when debugging without
# Have a way to run the tests without running collectstatic -- useful when debugging without
# messing with static files.
# messing with static files.
task
"fasttest_
#{
system
}
"
,
[
:stop_on_failure
]
=>
[
report_dir
,
:install_prereqs
,
:predjango
]
do
|
t
,
args
|
task
"fasttest_
#{
system
}
"
,
[
:
test_id
,
:
stop_on_failure
]
=>
[
report_dir
,
:install_prereqs
,
:predjango
]
do
|
t
,
args
|
args
.
with_defaults
(
:stop_on_failure
=>
'true'
)
args
.
with_defaults
(
:stop_on_failure
=>
'true'
,
:test_id
=>
nil
)
run_tests
(
system
,
report_dir
,
args
.
stop_on_failure
)
run_tests
(
system
,
report_dir
,
args
.
test_id
,
args
.
stop_on_failure
)
end
end
# Run acceptance tests
# Run acceptance tests
...
@@ -100,7 +101,7 @@ end
...
@@ -100,7 +101,7 @@ end
task
:test
do
task
:test
do
TEST_TASK_DIRS
.
each
do
|
dir
|
TEST_TASK_DIRS
.
each
do
|
dir
|
Rake
::
Task
[
"test_
#{
dir
}
"
].
invoke
(
false
)
Rake
::
Task
[
"test_
#{
dir
}
"
].
invoke
(
nil
,
false
)
end
end
if
$failed_tests
>
0
if
$failed_tests
>
0
...
...
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