Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
321fe20a
Commit
321fe20a
authored
Apr 27, 2014
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testrunner.py: report unexpected passes
parent
8fd25a87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
13 deletions
+42
-13
greentest/testrunner.py
greentest/testrunner.py
+37
-10
known_failures.py
known_failures.py
+5
-3
No files found.
greentest/testrunner.py
View file @
321fe20a
...
...
@@ -22,6 +22,7 @@ def run_many(tests, expected=None, failfast=False):
start
=
time
.
time
()
total
=
0
failed
=
{}
passed
=
{}
NWORKERS
=
min
(
len
(
tests
),
NWORKERS
)
or
1
pool
=
ThreadPool
(
NWORKERS
)
...
...
@@ -33,6 +34,8 @@ def run_many(tests, expected=None, failfast=False):
if
failfast
:
sys
.
exit
(
1
)
failed
[
result
.
name
]
=
[
cmd
,
kwargs
]
else
:
passed
[
result
.
name
]
=
True
results
=
[]
...
...
@@ -73,7 +76,7 @@ def run_many(tests, expected=None, failfast=False):
reap_all
()
except
KeyboardInterrupt
:
pool
.
terminate
()
report
(
total
,
failed
,
exit
=
False
,
took
=
time
.
time
()
-
start
,
expected
=
expected
)
report
(
total
,
failed
,
passed
,
exit
=
False
,
took
=
time
.
time
()
-
start
,
expected
=
expected
)
log
(
'(partial results)
\
n
'
)
raise
except
:
...
...
@@ -82,7 +85,7 @@ def run_many(tests, expected=None, failfast=False):
raise
reap_all
()
util
.
report
(
total
,
fail
ed
,
took
=
time
.
time
()
-
start
,
expected
=
expected
)
report
(
total
,
failed
,
pass
ed
,
took
=
time
.
time
()
-
start
,
expected
=
expected
)
def
discover
(
tests
=
None
,
ignore
=
None
):
...
...
@@ -127,9 +130,18 @@ def load_list_from_file(filename):
return
result
def
matches
(
expected
,
command
):
def
might_fail
(
expected
,
command
):
for
line
in
expected
:
if
command
.
endswith
(
' '
+
line
.
replace
(
'FLAKY '
,
''
)):
return
True
return
False
def
must_fail
(
expected
,
command
):
for
line
in
expected
:
if
command
.
endswith
(
' '
+
line
):
if
'FLAKY'
in
line
:
continue
if
command
.
endswith
(
' '
+
line
.
replace
(
'FLAKY '
,
''
)):
return
True
return
False
...
...
@@ -143,7 +155,7 @@ def format_seconds(seconds):
return
seconds
def
report
(
total
,
failed
,
exit
=
True
,
took
=
None
,
expected
=
None
):
def
report
(
total
,
failed
,
passed
,
exit
=
True
,
took
=
None
,
expected
=
None
):
runtimelog
=
util
.
runtimelog
if
runtimelog
:
log
(
'
\
n
Longest-running tests:'
)
...
...
@@ -159,34 +171,49 @@ def report(total, failed, exit=True, took=None, expected=None):
failed_expected
=
[]
failed_unexpected
=
[]
passed_unexpected
=
[]
for
name
in
passed
:
if
must_fail
(
expected
,
name
):
passed_unexpected
.
append
(
name
)
if
passed_unexpected
:
log
(
'
\
n
%s/%s unexpected passes'
,
len
(
passed_unexpected
),
total
)
print_list
(
passed_unexpected
)
if
failed
:
log
(
'
\
n
%s/%s tests failed%s'
,
len
(
failed
),
total
,
took
)
expected
=
set
(
expected
or
[])
for
name
in
failed
:
if
m
atches
(
expected
,
name
):
if
m
ight_fail
(
expected
,
name
):
failed_expected
.
append
(
name
)
else
:
failed_unexpected
.
append
(
name
)
if
failed_expected
:
log
(
'
\
n
%s/%s expected failures'
,
len
(
failed_expected
),
total
)
for
name
in
failed_expected
:
log
(
' - %s'
,
name
)
print_list
(
failed_expected
)
if
failed_unexpected
:
log
(
'
\
n
%s/%s unexpected failures'
,
len
(
failed_unexpected
),
total
)
for
name
in
failed_unexpected
:
log
(
' - %s'
,
name
)
print_list
(
failed_unexpected
)
else
:
log
(
'
\
n
%s tests passed%s'
,
total
,
took
)
if
exit
:
if
failed_unexpected
:
sys
.
exit
(
min
(
100
,
len
(
failed_unexpected
)))
if
passed_unexpected
:
sys
.
exit
(
101
)
if
total
<=
0
:
sys
.
exit
(
'No tests found.'
)
def
print_list
(
lst
):
for
name
in
lst
:
log
(
' - %s'
,
name
)
def
main
():
import
optparse
parser
=
optparse
.
OptionParser
()
...
...
known_failures.py
View file @
321fe20a
# This is a list of known failures (=bugs).
# The tests listed there must fail (or testrunner.py will report error) unless they are prefixed with FLAKY
# in which cases the result of them is simply ignored
import
os
import
sys
...
...
@@ -9,7 +11,7 @@ PYPY = hasattr(sys, 'pypy_version_info')
FAILING_TESTS
=
[
# needs investigating
'test__issue6.py'
,
'
FLAKY
test__issue6.py'
,
# bunch of SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
# seems to be Python/OpenSSL problem, not gevent's
...
...
@@ -21,8 +23,8 @@ FAILING_TESTS = [
if
os
.
environ
.
get
(
'GEVENT_RESOLVER'
)
==
'ares'
:
# XXX fix this
FAILING_TESTS
+=
[
'test__socket_dns.py'
,
'test__socket_dns6.py'
,
'
FLAKY
test__socket_dns.py'
,
'
FLAKY
test__socket_dns6.py'
,
]
...
...
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