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
d59c1c9e
Commit
d59c1c9e
authored
Mar 09, 2017
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --quiet option to testrunner.py and use it on CI
Fixes #926
parent
ca16b43f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
16 deletions
+21
-16
Makefile
Makefile
+4
-4
appveyor.yml
appveyor.yml
+1
-1
src/greentest/testrunner.py
src/greentest/testrunner.py
+6
-4
src/greentest/util.py
src/greentest/util.py
+10
-7
No files found.
Makefile
View file @
d59c1c9e
...
...
@@ -74,12 +74,12 @@ test_prelim:
make bench
toxtest
:
test_prelim
cd
src/greentest
&&
GEVENT_RESOLVER
=
thread
${PYTHON}
testrunner.py
--config
known_failures.py
cd
src/greentest
&&
GEVENT_RESOLVER
=
thread
${PYTHON}
testrunner.py
--config
known_failures.py
--quiet
fulltoxtest
:
test_prelim
cd
src/greentest
&&
GEVENT_RESOLVER
=
thread
${PYTHON}
testrunner.py
--config
known_failures.py
cd
src/greentest
&&
GEVENT_RESOLVER
=
ares
GEVENTARES_SERVERS
=
8.8.8.8
${PYTHON}
testrunner.py
--config
known_failures.py
--ignore
tests_that_dont_use_resolver.txt
cd
src/greentest
&&
GEVENT_FILE
=
thread
${PYTHON}
testrunner.py
--config
known_failures.py
`
grep
-l
subprocess test_
*
.py
`
cd
src/greentest
&&
GEVENT_RESOLVER
=
thread
${PYTHON}
testrunner.py
--config
known_failures.py
--quiet
cd
src/greentest
&&
GEVENT_RESOLVER
=
ares
GEVENTARES_SERVERS
=
8.8.8.8
${PYTHON}
testrunner.py
--config
known_failures.py
--ignore
tests_that_dont_use_resolver.txt
--quiet
cd
src/greentest
&&
GEVENT_FILE
=
thread
${PYTHON}
testrunner.py
--config
known_failures.py
`
grep
-l
subprocess test_
*
.py
`
--quiet
leaktest
:
GEVENTSETUP_EV_VERIFY
=
3
GEVENTTEST_LEAKCHECK
=
1 make fulltoxtest
...
...
appveyor.yml
View file @
d59c1c9e
...
...
@@ -145,7 +145,7 @@ build_script:
test_script
:
# Run the project tests
-
"
cd
src/greentest
&&
%PYEXE%
testrunner.py
--config
known_failures.py
&&
cd
../.."
-
"
cd
src/greentest
&&
%PYEXE%
testrunner.py
--config
known_failures.py
--quiet
&&
cd
../.."
after_test
:
# We already built the wheel during build_script, because it's
...
...
src/greentest/testrunner.py
View file @
d59c1c9e
...
...
@@ -45,7 +45,7 @@ IGNORE_COVERAGE = [
]
def
run_many
(
tests
,
expected
=
(),
failfast
=
False
):
def
run_many
(
tests
,
expected
=
(),
failfast
=
False
,
quiet
=
False
):
# pylint:disable=too-many-locals
global
NWORKERS
start
=
time
.
time
()
...
...
@@ -59,6 +59,7 @@ def run_many(tests, expected=(), failfast=False):
util
.
BUFFER_OUTPUT
=
NWORKERS
>
1
def
run_one
(
cmd
,
**
kwargs
):
kwargs
[
'quiet'
]
=
quiet
result
=
util
.
run
(
cmd
,
**
kwargs
)
if
result
:
if
failfast
:
...
...
@@ -84,7 +85,7 @@ def run_many(tests, expected=(), failfast=False):
while
reap
()
>
0
:
time
.
sleep
(
0.1
)
def
spawn
(
args
,
kwargs
):
# pylint:disable=unused-argument
def
spawn
(
cmd
,
options
):
while
True
:
if
reap
()
<
NWORKERS
:
r
=
pool
.
apply_async
(
run_one
,
(
cmd
,
),
options
or
{})
...
...
@@ -103,7 +104,7 @@ def run_many(tests, expected=(), failfast=False):
if
matches
(
RUN_ALONE
,
cmd
):
run_alone
.
append
((
cmd
,
options
))
else
:
spawn
(
(
cmd
,
)
,
options
)
spawn
(
cmd
,
options
)
pool
.
close
()
pool
.
join
()
...
...
@@ -276,6 +277,7 @@ def main():
parser
.
add_option
(
'--config'
)
parser
.
add_option
(
'--failfast'
,
action
=
'store_true'
)
parser
.
add_option
(
"--coverage"
,
action
=
"store_true"
)
parser
.
add_option
(
"--quiet"
,
action
=
"store_true"
)
options
,
args
=
parser
.
parse_args
()
FAILING_TESTS
=
[]
coverage
=
False
...
...
@@ -301,7 +303,7 @@ def main():
print
(
util
.
getname
(
cmd
,
env
=
options
.
get
(
'env'
),
setenv
=
options
.
get
(
'setenv'
)))
print
(
'%s tests found.'
%
len
(
tests
))
else
:
run_many
(
tests
,
expected
=
FAILING_TESTS
,
failfast
=
options
.
failfast
)
run_many
(
tests
,
expected
=
FAILING_TESTS
,
failfast
=
options
.
failfast
,
quiet
=
options
.
quiet
)
if
__name__
==
'__main__'
:
...
...
src/greentest/util.py
View file @
d59c1c9e
...
...
@@ -12,6 +12,7 @@ import time
runtimelog
=
[]
MIN_RUNTIME
=
1.0
BUFFER_OUTPUT
=
False
QUIET
=
False
class
Popen
(
subprocess
.
Popen
):
...
...
@@ -158,12 +159,11 @@ class RunResult(object):
self
.
output
=
output
self
.
name
=
name
if
six
.
PY3
:
def
__bool__
(
self
):
return
bool
(
self
.
code
)
else
:
def
__nonzero__
(
self
):
return
bool
(
self
.
code
)
def
__bool__
(
self
):
return
bool
(
self
.
code
)
__nonzero__
=
__bool__
def
__int__
(
self
):
return
self
.
code
...
...
@@ -174,6 +174,8 @@ lock = threading.Lock()
def
run
(
command
,
**
kwargs
):
buffer_output
=
kwargs
.
pop
(
'buffer_output'
,
BUFFER_OUTPUT
)
quiet
=
kwargs
.
pop
(
'quiet'
,
QUIET
)
verbose
=
not
quiet
if
buffer_output
:
assert
'stdout'
not
in
kwargs
and
'stderr'
not
in
kwargs
,
kwargs
kwargs
[
'stderr'
]
=
subprocess
.
STDOUT
...
...
@@ -192,7 +194,8 @@ def run(command, **kwargs):
kill
(
popen
)
assert
not
err
with
lock
:
if
out
:
failed
=
bool
(
result
)
if
out
and
(
failed
or
verbose
):
out
=
out
.
strip
().
decode
(
'utf-8'
,
'ignore'
)
if
out
:
out
=
' '
+
out
.
replace
(
'
\
n
'
,
'
\
n
'
)
...
...
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