Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
5de0ff3a
Commit
5de0ff3a
authored
8 years ago
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New neotestrunner option for code coverage testing
parent
4ef05b9e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
20 deletions
+36
-20
.coveragerc
.coveragerc
+6
-0
.gitignore
.gitignore
+2
-0
TESTS.txt
TESTS.txt
+0
-18
TODO
TODO
+1
-0
neo/scripts/runner.py
neo/scripts/runner.py
+15
-1
setup.py
setup.py
+1
-1
tools/coverage-html
tools/coverage-html
+11
-0
No files found.
.coveragerc
0 → 100644
View file @
5de0ff3a
[run]
source = neo
omit =
neo/debug.py
neo/scripts/runner.py
neo/tests/*
This diff is collapsed.
Click to expand it.
.gitignore
View file @
5de0ff3a
...
...
@@ -2,7 +2,9 @@
*.pyo
*.swp
*~
/.coverage
/build/
/dist/
/htmlcov/
/mock.py
/neoppod.egg-info/
This diff is collapsed.
Click to expand it.
TESTS.txt
deleted
100644 → 0
View file @
4ef05b9e
In order to check the test-coverage of Neo, we used the figleaf tool. The usage
(for a complete neo test suite) is :
Download and install figleaf : http://darcs.idyll.org/~t/projects/figleaf/doc/
$ figleaf neotestrunner -u (it will generate a .figleaf file)
$figleaf2html .figleaf (to convert .figleaf file in html pages)
$firefox html/ (to read the results)
Each one of the page contains Neo code, which the following colours :
Green : Executed code during test suite
Red : Unexecuted code
Black : Comments and "unused" lines
In order to check only needed neo file, you should specify the following options:
figleaf -i : ignore python libraries
figleaf2html -f : allows to specify a list of check-needed files
For stats, you can also check the index.html page, which indicated which
percentage of test-coverage.
This diff is collapsed.
Click to expand it.
TODO
View file @
5de0ff3a
...
...
@@ -15,6 +15,7 @@
General
- Review XXX/TODO code tags (CODE)
- Coverage for functional tests (i.e. collect results from subprocesses)
- When all cells are OUT_OF_DATE in backup mode, the one with most data
could become UP_TO_DATE with appropriate backup_tid, so that the cluster
stays operational. (FEATURE)
...
...
This diff is collapsed.
Click to expand it.
neo/scripts/runner.py
View file @
5de0ff3a
...
...
@@ -20,11 +20,19 @@ import unittest
import
logging
import
time
import
sys
import
neo
import
os
import
re
from
collections
import
Counter
,
defaultdict
from
cStringIO
import
StringIO
from
unittest.runner
import
_WritelnDecorator
if
filter
(
re
.
compile
(
r'--coverage$|-\
w*c
').match, sys.argv[1:]):
# Start coverage as soon as possible.
import coverage
coverage = coverage.Coverage()
coverage.start()
import neo
from neo.tests import getTempDirectory, __dict__ as neo_tests__dict__
from neo.tests.benchmark import BenchmarkRunner
...
...
@@ -201,6 +209,8 @@ class NeoTestRunner(unittest.TextTestResult):
class TestRunner(BenchmarkRunner):
def add_options(self, parser):
parser.add_option('
-
c
', '
--
coverage
', action='
store_true
',
help='
Enable
coverage
(
not
working
yet
for
functional
tests
)
')
parser.add_option('
-
f', '
--
functional
', action='
store_true
',
help='
Functional
tests
')
parser.add_option('
-
u', '
--
unit
', action='
store_true
',
...
...
@@ -238,6 +248,7 @@ Environment Variables:
functional = options.functional,
zodb = options.zodb,
verbosity = 2 if options.verbose else 1,
coverage = options.coverage,
)
def start(self):
...
...
@@ -254,6 +265,9 @@ Environment Variables:
except KeyboardInterrupt:
config['
mail_to
'] = None
traceback.print_exc()
if config.coverage:
coverage.stop()
coverage.save()
# build report
self._successful = runner.wasSuccessful()
return runner.buildReport(self.add_status)
...
...
This diff is collapsed.
Click to expand it.
setup.py
View file @
5de0ff3a
...
...
@@ -38,7 +38,7 @@ extras_require = {
'storage-mysqldb'
:
[
'mysqlclient'
],
'storage-importer'
:
zodb_require
,
}
extras_require
[
'tests'
]
=
[
'zope.testing'
,
'psutil>=2'
,
extras_require
[
'tests'
]
=
[
'
coverage'
,
'
zope.testing'
,
'psutil>=2'
,
'neoppod[%s]'
%
', '
.
join
(
extras_require
)]
try
:
...
...
This diff is collapsed.
Click to expand it.
tools/coverage-html
0 → 100755
View file @
5de0ff3a
#!/bin/sh -e
for
COV
in
coverage python-coverage
do
type
$COV
&&
break
done
>
/dev/null 2>&1
||
exit
$COV
html
"
$@
"
# https://bitbucket.org/ned/coveragepy/issues/474/javascript-in-html-captures-all-keys
sed
-i
"
/assign_shortkeys *=/s/
$/
return;/
/^ *
\.
bind('keydown',/s,^,//,
"
htmlcov/coverage_html.js
This diff is collapsed.
Click to expand it.
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