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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matevz Golob
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
Hide 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
...
@@ -10,7 +10,7 @@ separator1 = '=' * 70
separator2
=
'-'
*
70
separator2
=
'-'
*
70
RUN_RE
=
re
.
compile
(
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
)
re
.
DOTALL
)
STATUS_RE
=
re
.
compile
(
r"""
STATUS_RE
=
re
.
compile
(
r"""
...
@@ -24,11 +24,11 @@ STATUS_RE = re.compile(r"""
...
@@ -24,11 +24,11 @@ STATUS_RE = re.compile(r"""
"""
,
re
.
DOTALL
|
re
.
VERBOSE
)
"""
,
re
.
DOTALL
|
re
.
VERBOSE
)
FTEST_PASS_FAIL_RE
=
re
.
compile
(
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+)
"
)
TRACEBACK_RE = re.compile(separator1 + "
\
n
(
?
P
<
tb
>
.
*
)
", re.DOTALL)
SVN_INFO_REV_RE
=
re
.
compile
(
r"Revision: (?P<rev>\
d+)
")
TRACEBACK_RE = re.compile(separator1 + "
\
n
(
?
P
<
tb
>
.
*
)
", re.DOTALL) # XXX how does "
\
n
" is interpreted here?
def parseTestSuiteResults(file_handler):
def parseTestSuiteResults(file_handler):
"""
"""
...
@@ -36,7 +36,7 @@ def parseTestSuiteResults(file_handler):
...
@@ -36,7 +36,7 @@ def parseTestSuiteResults(file_handler):
Return:
Return:
- successfull tests
- successfull tests
- failed tests
- failed tests
- errors
- errors
- log files
- log files
# Note: this can be debugged with:
# Note: this can be debugged with:
...
@@ -63,7 +63,7 @@ def parseTestSuiteResults(file_handler):
...
@@ -63,7 +63,7 @@ def parseTestSuiteResults(file_handler):
if file_data != '':
if file_data != '':
test_results.setdefault(test_name, {})[file_name] = file_data
test_results.setdefault(test_name, {})[file_name] = file_data
sorted_test_dict[test_index] = test_name
sorted_test_dict[test_index] = test_name
for sort_test_key in sorted(sorted_test_dict.keys()):
for sort_test_key in sorted(sorted_test_dict.keys()):
test_id = sorted_test_dict[sort_test_key]
test_id = sorted_test_dict[sort_test_key]
test_result_detail = test_results[test_id]
test_result_detail = test_results[test_id]
...
@@ -116,7 +116,7 @@ def parseTestSuiteResults(file_handler):
...
@@ -116,7 +116,7 @@ def parseTestSuiteResults(file_handler):
passes = int(groupdict.get('passes', 0))
passes = int(groupdict.get('passes', 0))
failures = int(groupdict.get('failures', 0))
failures = int(groupdict.get('failures', 0))
all_tests = passes + failures
all_tests = passes + failures
else:
else:
# get all tests and elapsed time
# get all tests and elapsed time
search = RUN_RE.search(test_log)
search = RUN_RE.search(test_log)
...
@@ -334,48 +334,41 @@ def TestResultModule_viewTestResultChart(self, REQUEST,
...
@@ -334,48 +334,41 @@ def TestResultModule_viewTestResultChart(self, REQUEST,
This is experimental use of matplotlib, not integrated with a field.
This is experimental use of matplotlib, not integrated with a field.
"""
"""
return 'disabled'
return 'disabled'
# XXX matplotlib cannot be imported it $HOME is not writable
## XXX matplotlib cannot be imported it $HOME is not writable
os.environ['HOME'] = '/tmp'
#os.environ['HOME'] = '/tmp'
# use a backend that doesn't need a $DISPLAY
## use a backend that doesn't need a $DISPLAY
try:
#import matplotlib
import matplotlib
#matplotlib.use('Cairo')
except ImportError:
#import pylab
return
matplotlib.use('Cairo')
#revision_list = []
try:
#all_test_list = []
import pylab
#success_list = []
except ImportError:
return
#for test in self.searchFolder(
# title=title,
revision_list = []
# int_index=dict(range='minmax',
all_test_list = []
# query=(min_rev or 0,
success_list = []
# max_rev or sys.maxint))):
# test = test.getObject()
for test in self.searchFolder(
# if not test.getIntIndex():
title=title,
# continue
int_index=dict(range='minmax',
# revision_list.append(test.getIntIndex())
query=(min_rev or 0,
# all_tests = int(test.getProperty('all_tests', 0))
max_rev or sys.maxint))):
# all_test_list.append(all_tests)
test = test.getObject()
# failures = (int(test.getProperty('errors', 0)) +
if not test.getIntIndex():
# int(test.getProperty('failures', 0)))
continue
# success_list.append(all_tests - failures)
revision_list.append(test.getIntIndex())
all_tests = int(test.getProperty('all_tests', 0))
#pylab.plot(revision_list, all_test_list)
all_test_list.append(all_tests)
#pylab.plot(revision_list, success_list)
failures = (int(test.getProperty('errors', 0)) +
#pylab.xlabel('svn revision')
int(test.getProperty('failures', 0)))
#pylab.legend(['all tests', 'success'])
success_list.append(all_tests - failures)
## returns the image
pylab.plot(revision_list, all_test_list)
#out = StringIO()
pylab.plot(revision_list, success_list)
#pylab.savefig(out, format='png')
pylab.xlabel('svn revision')
#REQUEST.RESPONSE.setHeader('Content-type', 'image/png')
pylab.legend(['all tests', 'success'])
#pylab.close()
#return out.getvalue()
# 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 @@
...
@@ -48,19 +48,8 @@
<tuple>
<tuple>
<string>
W:265, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)
</string>
<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: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:110, 6: Unused variable \'junk\' (unused-variable)
</string>
<string>
W:190, 4: Unused variable \'only_func_test\' (unused-variable)
</string>
<string>
W:190, 4: Unused variable \'only_func_test\' (unused-variable)
</string>
<string>
W:338, 2: Unreachable code (unreachable)
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</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