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
3dc23eb1
Commit
3dc23eb1
authored
Nov 07, 2012
by
Ned Batchelder
Committed by
Calen Pennington
Nov 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coverage xml and html reports are now a separate 'xml' and 'html' step from 'test'.
parent
c3f0d31c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
14 deletions
+32
-14
cms/.coveragerc
+3
-0
common/lib/capa/.coveragerc
+3
-0
common/lib/xmodule/.coveragerc
+4
-1
lms/.coveragerc
+4
-1
rakefile
+18
-12
No files found.
cms/.coveragerc
View file @
3dc23eb1
# .coveragerc for cms
# .coveragerc for cms
[run]
data_file = cms/.coverage
[report]
[report]
ignore_errors = True
ignore_errors = True
...
...
common/lib/capa/.coveragerc
View file @
3dc23eb1
# .coveragerc for common/lib/capa
# .coveragerc for common/lib/capa
[run]
data_file = common/lib/capa/.coverage
[report]
[report]
ignore_errors = True
ignore_errors = True
...
...
common/lib/xmodule/.coveragerc
View file @
3dc23eb1
# .coveragerc for common/lib/xmodule
# .coveragerc for common/lib/xmodule
[run]
data_file = common/lib/xmodule/.coverage
[report]
[report]
ignore_errors = True
ignore_errors = True
[html]
[html]
directory = reports/common/
xmodule/capa
/cover
directory = reports/common/
lib/xmodule
/cover
[xml]
[xml]
output = reports/common/lib/xmodule/coverage.xml
output = reports/common/lib/xmodule/coverage.xml
lms/.coveragerc
View file @
3dc23eb1
# .coveragerc for cms
# .coveragerc for lms
[run]
data_file = lms/.coverage
[report]
[report]
ignore_errors = True
ignore_errors = True
...
...
rakefile
View file @
3dc23eb1
...
@@ -92,11 +92,6 @@ def run_under_coverage(cmd, root)
...
@@ -92,11 +92,6 @@ def run_under_coverage(cmd, root)
return
cmd
return
cmd
end
end
def
coverage_reports
(
root
)
sh
(
"coverage xml --rcfile=
#{
root
}
/.coveragerc"
)
sh
(
"coverage html --rcfile=
#{
root
}
/.coveragerc"
)
end
def
run_tests
(
system
,
report_dir
,
stop_on_failure
=
true
)
def
run_tests
(
system
,
report_dir
,
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/*"
]
...
@@ -107,10 +102,9 @@ def run_tests(system, report_dir, stop_on_failure=true)
...
@@ -107,10 +102,9 @@ def run_tests(system, report_dir, stop_on_failure=true)
end
end
$failed_tests
+=
1
unless
ok
$failed_tests
+=
1
unless
ok
end
end
coverage_reports
(
system
)
end
end
TEST_TASK_
SYMBOL
S
=
[]
TEST_TASK_
DIR
S
=
[]
[
:lms
,
:cms
].
each
do
|
system
|
[
:lms
,
:cms
].
each
do
|
system
|
report_dir
=
File
.
join
(
REPORT_DIR
,
system
.
to_s
)
report_dir
=
File
.
join
(
REPORT_DIR
,
system
.
to_s
)
...
@@ -127,7 +121,7 @@ TEST_TASK_SYMBOLS = []
...
@@ -127,7 +121,7 @@ TEST_TASK_SYMBOLS = []
run_tests
(
system
,
report_dir
,
args
.
stop_on_failure
)
run_tests
(
system
,
report_dir
,
args
.
stop_on_failure
)
end
end
TEST_TASK_
SYMBOL
S
<<
system
TEST_TASK_
DIR
S
<<
system
desc
<<-
desc
desc
<<-
desc
Start the
#{
system
}
locally with the specified environment (defaults to dev).
Start the
#{
system
}
locally with the specified environment (defaults to dev).
...
@@ -170,9 +164,8 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
...
@@ -170,9 +164,8 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
sh
(
run_under_coverage
(
cmd
,
lib
))
do
|
ok
,
res
|
sh
(
run_under_coverage
(
cmd
,
lib
))
do
|
ok
,
res
|
$failed_tests
+=
1
unless
ok
$failed_tests
+=
1
unless
ok
end
end
coverage_reports
(
lib
)
end
end
TEST_TASK_
SYMBOL
S
<<
lib
TEST_TASK_
DIR
S
<<
lib
desc
"Run tests for common lib
#{
lib
}
(without coverage)"
desc
"Run tests for common lib
#{
lib
}
(without coverage)"
task
"fasttest_
#{
lib
}
"
do
task
"fasttest_
#{
lib
}
"
do
...
@@ -182,8 +175,8 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
...
@@ -182,8 +175,8 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
end
end
task
:test
do
task
:test
do
TEST_TASK_
SYMBOLS
.
each
do
|
sym
|
TEST_TASK_
DIRS
.
each
do
|
dir
|
Rake
::
Task
[
"test_
#{
sym
}
"
].
invoke
(
false
)
Rake
::
Task
[
"test_
#{
dir
}
"
].
invoke
(
false
)
end
end
if
$failed_tests
>
0
if
$failed_tests
>
0
...
@@ -191,6 +184,19 @@ task :test do
...
@@ -191,6 +184,19 @@ task :test do
end
end
end
end
task
:html
do
TEST_TASK_DIRS
.
each
do
|
dir
|
sh
(
"coverage html --rcfile=
#{
dir
}
/.coveragerc"
)
end
end
task
:xml
do
TEST_TASK_DIRS
.
each
do
|
dir
|
# Why doesn't the rcfile control the xml output file properly??
sh
(
"coverage xml -o reports/
#{
dir
}
/coverage.xml --rcfile=
#{
dir
}
/.coveragerc"
)
end
end
task
:runserver
=>
:lms
task
:runserver
=>
:lms
desc
"Run django-admin <action> against the specified system and environment"
desc
"Run django-admin <action> against the specified system and environment"
...
...
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