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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
624b3d1d
Commit
624b3d1d
authored
Nov 26, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
make testnode test less verbose
Don't log and fix a few resource warnings See merge request
!1307
parents
6c272cab
9c60d750
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
24 deletions
+23
-24
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+0
-5
erp5/util/testnode/ProcessManager.py
erp5/util/testnode/ProcessManager.py
+22
-19
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+1
-0
No files found.
erp5/tests/testERP5TestNode.py
View file @
624b3d1d
...
@@ -38,9 +38,6 @@ def dummySuiteLog(_):
...
@@ -38,9 +38,6 @@ def dummySuiteLog(_):
class
ERP5TestNode
(
TestCase
):
class
ERP5TestNode
(
TestCase
):
_handler
=
logging
.
StreamHandler
(
sys
.
stdout
)
_handler
.
setFormatter
(
logging
.
Formatter
(
'TESTNODE LOG: %(message)s'
))
def
setUp
(
self
):
def
setUp
(
self
):
self
.
_temp_dir
=
tempfile
.
mkdtemp
()
self
.
_temp_dir
=
tempfile
.
mkdtemp
()
self
.
working_directory
=
os
.
path
.
join
(
self
.
_temp_dir
,
'testnode'
)
self
.
working_directory
=
os
.
path
.
join
(
self
.
_temp_dir
,
'testnode'
)
...
@@ -66,11 +63,9 @@ class ERP5TestNode(TestCase):
...
@@ -66,11 +63,9 @@ class ERP5TestNode(TestCase):
os
.
mkdir
(
self
.
remote_repository0
)
os
.
mkdir
(
self
.
remote_repository0
)
os
.
mkdir
(
self
.
remote_repository1
)
os
.
mkdir
(
self
.
remote_repository1
)
os
.
mkdir
(
self
.
remote_repository2
)
os
.
mkdir
(
self
.
remote_repository2
)
logging
.
getLogger
().
addHandler
(
self
.
_handler
)
def
tearDown
(
self
):
def
tearDown
(
self
):
shutil
.
rmtree
(
self
.
_temp_dir
,
True
)
shutil
.
rmtree
(
self
.
_temp_dir
,
True
)
logging
.
getLogger
().
removeHandler
(
self
.
_handler
)
def
getTestNode
(
self
):
def
getTestNode
(
self
):
config
=
{}
config
=
{}
...
...
erp5/util/testnode/ProcessManager.py
View file @
624b3d1d
...
@@ -136,8 +136,6 @@ def killCommand(pid):
...
@@ -136,8 +136,6 @@ def killCommand(pid):
class
ProcessManager
(
object
):
class
ProcessManager
(
object
):
stdin
=
open
(
os
.
devnull
)
def
__init__
(
self
,
max_timeout
=
MAX_TIMEOUT
):
def
__init__
(
self
,
max_timeout
=
MAX_TIMEOUT
):
self
.
process_pid_set
=
set
()
self
.
process_pid_set
=
set
()
signal
.
signal
(
signal
.
SIGTERM
,
self
.
sigterm_handler
)
signal
.
signal
(
signal
.
SIGTERM
,
self
.
sigterm_handler
)
...
@@ -176,7 +174,9 @@ class ProcessManager(object):
...
@@ -176,7 +174,9 @@ class ProcessManager(object):
logger
.
info
(
'subprocess_kw : %r'
,
subprocess_kw
)
logger
.
info
(
'subprocess_kw : %r'
,
subprocess_kw
)
logger
.
info
(
'$ %s'
,
command
)
logger
.
info
(
'$ %s'
,
command
)
sys
.
stdout
.
flush
()
sys
.
stdout
.
flush
()
p
=
subprocess
.
Popen
(
args
,
stdin
=
self
.
stdin
,
stdout
=
subprocess
.
PIPE
,
with
open
(
os
.
devnull
)
as
stdin
:
p
=
subprocess
.
Popen
(
args
,
stdin
=
stdin
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
env
=
env
,
close_fds
=
True
,
stderr
=
subprocess
.
PIPE
,
env
=
env
,
close_fds
=
True
,
**
subprocess_kw
)
**
subprocess_kw
)
self
.
process_pid_set
.
add
(
p
.
pid
)
self
.
process_pid_set
.
add
(
p
.
pid
)
...
@@ -189,6 +189,9 @@ class ProcessManager(object):
...
@@ -189,6 +189,9 @@ class ProcessManager(object):
result
=
dict
(
status_code
=
p
.
returncode
,
command
=
command
,
result
=
dict
(
status_code
=
p
.
returncode
,
command
=
command
,
stdout
=
stdout
,
stderr
=
stderr
)
stdout
=
stdout
,
stderr
=
stderr
)
self
.
process_pid_set
.
discard
(
p
.
pid
)
self
.
process_pid_set
.
discard
(
p
.
pid
)
p
.
stdout
.
close
()
p
.
stderr
.
close
()
if
self
.
under_cancellation
:
if
self
.
under_cancellation
:
raise
CancellationError
(
"Test Result was cancelled"
)
raise
CancellationError
(
"Test Result was cancelled"
)
if
raise_error_if_fail
and
p
.
returncode
:
if
raise_error_if_fail
and
p
.
returncode
:
...
...
erp5/util/testnode/testnode.py
View file @
624b3d1d
...
@@ -190,6 +190,7 @@ shared = true
...
@@ -190,6 +190,7 @@ shared = true
finally
:
finally
:
logger
.
propagate
=
True
logger
.
propagate
=
True
logger
.
removeHandler
(
handler
)
logger
.
removeHandler
(
handler
)
handler
.
close
()
def
checkRevision
(
self
,
test_result
,
node_test_suite
):
def
checkRevision
(
self
,
test_result
,
node_test_suite
):
if
node_test_suite
.
revision
==
test_result
.
revision
:
if
node_test_suite
.
revision
==
test_result
.
revision
:
...
...
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