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
23a1947a
Commit
23a1947a
authored
Jan 24, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collect coverage for bok-choy tests
parent
58355f07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
7 deletions
+39
-7
.gitignore
+1
-0
common/test/acceptance/.coveragerc
+15
-0
rakelib/bok_choy.rake
+23
-7
No files found.
.gitignore
View file @
23a1947a
...
...
@@ -44,6 +44,7 @@ conf/locale/ko_KR
.noseids
nosetests.xml
.coverage
.coverage.*
coverage.xml
cover/
cover_html/
...
...
common/test/acceptance/.coveragerc
0 → 100644
View file @
23a1947a
[run]
data_file = reports/bok_choy/.coverage
source = lms, cms, common/djangoapps, common/lib
omit = lms/envs/*, cms/envs/*, common/djangoapps/terrain/*, common/djangoapps/*/migrations/*, */test*, */management/*, */urls*, */wsgi*
parallel = True
[report]
ignore_errors = True
[html]
title = Bok Choy Test Coverage Report
directory = reports/bok_choy/cover
[xml]
output = reports/bok_choy/coverage.xml
rakelib/bok_choy.rake
View file @
23a1947a
...
...
@@ -12,11 +12,16 @@ BOK_CHOY_NUM_PARALLEL = ENV.fetch('NUM_PARALLEL', 1).to_i
BOK_CHOY_TEST_TIMEOUT
=
ENV
.
fetch
(
"TEST_TIMEOUT"
,
300
).
to_f
# Ensure that we have a directory to put logs and reports
BOK_CHOY_TEST_DIR
=
File
.
join
(
REPO_ROOT
,
"common"
,
"test"
,
"acceptance"
,
"tests"
)
BOK_CHOY_DIR
=
File
.
join
(
REPO_ROOT
,
"common"
,
"test"
,
"acceptance"
)
BOK_CHOY_TEST_DIR
=
File
.
join
(
BOK_CHOY_DIR
,
"tests"
)
BOK_CHOY_LOG_DIR
=
File
.
join
(
REPO_ROOT
,
"test_root"
,
"log"
)
directory
BOK_CHOY_LOG_DIR
BOK_CHOY_XUNIT_REPORT
=
report_dir_path
(
"bok_choy_xunit.xml"
)
# Reports
BOK_CHOY_REPORT_DIR
=
report_dir_path
(
"bok_choy"
)
BOK_CHOY_XUNIT_REPORT
=
File
.
join
(
BOK_CHOY_REPORT_DIR
,
"xunit.xml"
)
BOK_CHOY_COVERAGE_RC
=
File
.
join
(
BOK_CHOY_DIR
,
".coveragerc"
)
directory
BOK_CHOY_REPORT_DIR
BOK_CHOY_SERVERS
=
{
...
...
@@ -31,10 +36,8 @@ BOK_CHOY_CACHE = Dalli::Client.new('localhost:11211')
def
start_servers
()
BOK_CHOY_SERVERS
.
each
do
|
service
,
info
|
address
=
"0.0.0.0:
#{
info
[
:port
]
}
"
singleton_process
(
django_admin
(
service
,
'bok_choy'
,
'runserver'
,
address
),
logfile
=
info
[
:log
]
)
cmd
=
"coverage run --rcfile=
#{
BOK_CHOY_COVERAGE_RC
}
-m manage
#{
service
}
--settings bok_choy runserver
#{
address
}
--traceback --noreload"
singleton_process
(
cmd
,
logfile
=
info
[
:log
])
end
end
...
...
@@ -166,7 +169,9 @@ namespace :'test:bok_choy' do
end
desc
"Run acceptance tests that use the bok-choy framework but skip setup"
task
:fast
,
[
:test_spec
]
=>
[
:check_services
,
BOK_CHOY_LOG_DIR
]
do
|
t
,
args
|
task
:fast
,
[
:test_spec
]
=>
[
:check_services
,
BOK_CHOY_LOG_DIR
,
BOK_CHOY_REPORT_DIR
,
:clean_reports_dir
]
do
|
t
,
args
|
# Ensure the test servers are available
puts
"Starting test servers..."
.
red
...
...
@@ -186,6 +191,17 @@ namespace :'test:bok_choy' do
end
end
desc
"Generate coverage reports for bok-choy tests"
task
:coverage
=>
BOK_CHOY_REPORT_DIR
do
|
t
,
args
|
puts
"Combining coverage reports"
.
red
sh
(
"coverage combine --rcfile=
#{
BOK_CHOY_COVERAGE_RC
}
"
)
puts
"Generating coverage reports"
.
red
sh
(
"coverage html --rcfile=
#{
BOK_CHOY_COVERAGE_RC
}
"
)
sh
(
"coverage xml --rcfile=
#{
BOK_CHOY_COVERAGE_RC
}
"
)
sh
(
"coverage report --rcfile=
#{
BOK_CHOY_COVERAGE_RC
}
"
)
end
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