Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
0e28fbb8
Commit
0e28fbb8
authored
Feb 06, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/neo/t/nxd/runTestSuite: Also run go & py unit tests in addition to bench-local
parent
f67c147d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
9 deletions
+55
-9
go/neo/t/nxd/runTestSuite
go/neo/t/nxd/runTestSuite
+55
-9
No files found.
go/neo/t/nxd/runTestSuite
View file @
0e28fbb8
...
@@ -25,7 +25,7 @@ neotest must be on $PATH.
...
@@ -25,7 +25,7 @@ neotest must be on $PATH.
from
erp5.util.taskdistribution
import
TaskDistributor
from
erp5.util.taskdistribution
import
TaskDistributor
from
subprocess
import
Popen
,
PIPE
from
subprocess
import
Popen
,
PIPE
from
time
import
time
,
strftime
,
gmtime
from
time
import
time
,
strftime
,
gmtime
import
os
,
sys
,
threading
,
argparse
,
logging
,
traceback
import
os
,
sys
,
threading
,
argparse
,
logging
,
traceback
,
re
def
main
():
def
main
():
...
@@ -53,7 +53,7 @@ def main():
...
@@ -53,7 +53,7 @@ def main():
tool
=
TaskDistributor
(
portal_url
=
args
.
master_url
,
logger
=
logger
)
tool
=
TaskDistributor
(
portal_url
=
args
.
master_url
,
logger
=
logger
)
test_result
=
tool
.
createTestResult
(
test_result
=
tool
.
createTestResult
(
revision
=
args
.
revision
,
revision
=
args
.
revision
,
test_name_list
=
[
'bench-local'
],
test_name_list
=
[
'
test-go'
,
'test-py'
,
'
bench-local'
],
node_title
=
args
.
test_node_title
,
node_title
=
args
.
test_node_title
,
test_title
=
args
.
test_suite_title
or
args
.
test_suite
,
test_title
=
args
.
test_suite_title
or
args
.
test_suite
,
project_title
=
args
.
project_title
)
project_title
=
args
.
project_title
)
...
@@ -76,7 +76,8 @@ def main():
...
@@ -76,7 +76,8 @@ def main():
break
break
# run `neotest <test-name>`
# run `neotest <test-name>`
argv
=
[
'neotest'
,
test_result_line
.
name
]
testname
=
test_result_line
.
name
argv
=
[
'neotest'
,
testname
]
tstart
=
time
()
tstart
=
time
()
try
:
try
:
...
@@ -102,9 +103,32 @@ def main():
...
@@ -102,9 +103,32 @@ def main():
p
.
wait
()
p
.
wait
()
ok
=
(
p
.
returncode
==
0
)
ok
=
(
p
.
returncode
==
0
)
tend
=
time
()
# default status dict just by exit code
status
=
{
'test_count'
:
1
,
'error_count'
:
(
0
if
ok
else
1
),
'failure_count'
:
0
,
'skip_count'
:
0
,
#html_test_result
}
# postprocess output, if we can
summaryf
=
globals
().
get
(
testname
.
replace
(
'-'
,
'_'
)
+
'_summary'
)
if
summaryf
is
not
None
:
try
:
summary
=
summaryf
(
stdout
)
except
:
bad
=
traceback
.
format_exc
()
sys
.
stderr
.
write
(
bad
)
stderr
+=
bad
status
[
'error_count'
]
+=
1
else
:
status
.
update
(
summary
)
tend
=
time
()
# report result of test run back to master
# report result of test run back to master
test_result_line
.
stop
(
test_result_line
.
stop
(
command
=
' '
.
join
(
argv
),
command
=
' '
.
join
(
argv
),
...
@@ -114,11 +138,7 @@ def main():
...
@@ -114,11 +138,7 @@ def main():
stdout
=
stdout
,
stdout
=
stdout
,
stderr
=
stderr
,
stderr
=
stderr
,
test_count
=
1
,
**
status
error_count
=
(
0
if
ok
else
1
),
failure_count
=
0
,
skip_count
=
0
,
#html_test_result
)
)
# tee, similar to tee(1) utility, copies data from fin to fout appending them to buf.
# tee, similar to tee(1) utility, copies data from fin to fout appending them to buf.
...
@@ -140,5 +160,31 @@ def tee(fin, fout, buf):
...
@@ -140,5 +160,31 @@ def tee(fin, fout, buf):
buf
.
append
(
data
)
buf
.
append
(
data
)
# xint converts number from neo/py test output to integer
def
xint
(
s
):
s
=
s
.
strip
()
if
s
==
'.'
:
return
0
else
:
return
int
(
s
)
# extract summary from neo/py test run
def
test_py_summary
(
stdout
):
# Test Module | run | unexpected | expected | skipped | time
# ...
# Summary | 366 | . | 9 | . | 353.47s
m
=
re
.
search
(
r'^\
s*summ
ary.*$'
,
stdout
,
re
.
M
|
re
.
I
)
assert
m
is
not
None
,
"could not find summary line"
summary
=
m
.
group
(
0
)
_
,
nrun
,
nfail
,
nxfail
,
nskip
,
_
=
summary
.
split
(
'|'
)
return
{
'test_count'
:
xint
(
nrun
),
'error_count'
:
xint
(
nfail
),
'failure_count'
:
xint
(
nxfail
),
'skip_count'
:
xint
(
nskip
),
}
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
main
()
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