Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vivek
erp5
Commits
3afa6a67
Commit
3afa6a67
authored
Oct 07, 2015
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_test_result: fix some pylint errors on extension.erp5.TestResults
parent
37b795fb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
64 deletions
+46
-64
bt5/erp5_test_result/ExtensionTemplateItem/portal_components/extension.erp5.TestResults.py
...plateItem/portal_components/extension.erp5.TestResults.py
+46
-53
bt5/erp5_test_result/ExtensionTemplateItem/portal_components/extension.erp5.TestResults.xml
...lateItem/portal_components/extension.erp5.TestResults.xml
+0
-11
No files found.
bt5/erp5_test_result/ExtensionTemplateItem/portal_components/extension.erp5.TestResults.py
View file @
3afa6a67
...
...
@@ -10,7 +10,7 @@ separator1 = '=' * 70
separator2
=
'-'
*
70
RUN_RE
=
re
.
compile
(
'Ran
\
s*(?P<
a
ll_tests>
\
d+)
\
s*test(s)?
\
s*i
n
\
s*(?P<seco
n
ds>
\
d+.
\
d+)s'
,
r
'Ran\
s*(?P<
all_tests>\
d+)
\s*test(s)?\
s*i
n\
s*(?P<seco
nds>\
d+.
\d+)s'
,
re
.
DOTALL
)
STATUS_RE
=
re
.
compile
(
r"""
...
...
@@ -24,11 +24,11 @@ STATUS_RE = re.compile(r"""
"""
,
re
.
DOTALL
|
re
.
VERBOSE
)
FTEST_PASS_FAIL_RE
=
re
.
compile
(
'.*Functional Tests, (?P<passes>
\
d+) P
a
sses, (?P<failures>
\
d+) F
a
ilures'
)
r
'.*Functional Tests, (?P<passes>\
d+) P
asses, (?P<failures>\
d+) F
ailures'
)
SVN_INFO_REV_RE
=
re
.
compile
(
"Revision: (?P<rev>
\
d+)
"
)
SVN_INFO_REV_RE
=
re
.
compile
(
r
"Revision: (?P<rev>\
d+)
")
TRACEBACK_RE = re.compile(separator1 + "
\
n
(
?
P
<
tb
>
.
*
)
", re.DOTALL)
TRACEBACK_RE = re.compile(separator1 + "
\
n
(
?
P
<
tb
>
.
*
)
", re.DOTALL)
# XXX how does "
\
n
" is interpreted here?
def parseTestSuiteResults(file_handler):
"""
...
...
@@ -334,48 +334,41 @@ def TestResultModule_viewTestResultChart(self, REQUEST,
This is experimental use of matplotlib, not integrated with a field.
"""
return 'disabled'
# XXX matplotlib cannot be imported it $HOME is not writable
os.environ['HOME'] = '/tmp'
# use a backend that doesn't need a $DISPLAY
try:
import matplotlib
except ImportError:
return
matplotlib.use('Cairo')
try:
import pylab
except ImportError:
return
revision_list = []
all_test_list = []
success_list = []
for test in self.searchFolder(
title=title,
int_index=dict(range='minmax',
query=(min_rev or 0,
max_rev or sys.maxint))):
test = test.getObject()
if not test.getIntIndex():
continue
revision_list.append(test.getIntIndex())
all_tests = int(test.getProperty('all_tests', 0))
all_test_list.append(all_tests)
failures = (int(test.getProperty('errors', 0)) +
int(test.getProperty('failures', 0)))
success_list.append(all_tests - failures)
pylab.plot(revision_list, all_test_list)
pylab.plot(revision_list, success_list)
pylab.xlabel('svn revision')
pylab.legend(['all tests', 'success'])
# returns the image
out = StringIO()
pylab.savefig(out, format='png')
REQUEST.RESPONSE.setHeader('Content-type', 'image/png')
pylab.close()
return out.getvalue()
## XXX matplotlib cannot be imported it $HOME is not writable
#os.environ['HOME'] = '/tmp'
## use a backend that doesn't need a $DISPLAY
#import matplotlib
#matplotlib.use('Cairo')
#import pylab
#revision_list = []
#all_test_list = []
#success_list = []
#for test in self.searchFolder(
# title=title,
# int_index=dict(range='minmax',
# query=(min_rev or 0,
# max_rev or sys.maxint))):
# test = test.getObject()
# if not test.getIntIndex():
# continue
# revision_list.append(test.getIntIndex())
# all_tests = int(test.getProperty('all_tests', 0))
# all_test_list.append(all_tests)
# failures = (int(test.getProperty('errors', 0)) +
# int(test.getProperty('failures', 0)))
# success_list.append(all_tests - failures)
#pylab.plot(revision_list, all_test_list)
#pylab.plot(revision_list, success_list)
#pylab.xlabel('svn revision')
#pylab.legend(['all tests', 'success'])
## returns the image
#out = StringIO()
#pylab.savefig(out, format='png')
#REQUEST.RESPONSE.setHeader('Content-type', 'image/png')
#pylab.close()
#return out.getvalue()
bt5/erp5_test_result/ExtensionTemplateItem/portal_components/extension.erp5.TestResults.xml
View file @
3afa6a67
...
...
@@ -48,19 +48,8 @@
<tuple>
<string>
W:265, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)
</string>
<string>
W:266, 0: Bad indentation. Found 16 spaces, expected 12 (bad-indentation)
</string>
<string>
W: 13, 0: Anomalous backslash in string: \'\\s\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 13, 0: Anomalous backslash in string: \'\\d\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 13, 0: Anomalous backslash in string: \'\\s\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 13, 0: Anomalous backslash in string: \'\\s\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 13, 0: Anomalous backslash in string: \'\\s\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 13, 0: Anomalous backslash in string: \'\\d\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 13, 0: Anomalous backslash in string: \'\\d\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 27, 0: Anomalous backslash in string: \'\\d\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 27, 0: Anomalous backslash in string: \'\\d\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W: 29, 0: Anomalous backslash in string: \'\\d\'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
</string>
<string>
W:110, 6: Unused variable \'junk\' (unused-variable)
</string>
<string>
W:190, 4: Unused variable \'only_func_test\' (unused-variable)
</string>
<string>
W:338, 2: Unreachable code (unreachable)
</string>
</tuple>
</value>
</item>
...
...
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