Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nxdtest
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
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
Jérome Perrin
nxdtest
Commits
ae543059
Commit
ae543059
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
a143f8e6
Changes
1
Hide 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 @
ae543059
...
...
@@ -25,7 +25,7 @@ neotest must be on $PATH.
from
erp5.util.taskdistribution
import
TaskDistributor
from
subprocess
import
Popen
,
PIPE
from
time
import
time
,
strftime
,
gmtime
import
os
,
sys
,
threading
,
argparse
,
logging
,
traceback
import
os
,
sys
,
threading
,
argparse
,
logging
,
traceback
,
re
def
main
():
...
...
@@ -53,7 +53,7 @@ def main():
tool
=
TaskDistributor
(
portal_url
=
args
.
master_url
,
logger
=
logger
)
test_result
=
tool
.
createTestResult
(
revision
=
args
.
revision
,
test_name_list
=
[
'bench-local'
],
test_name_list
=
[
'
test-go'
,
'test-py'
,
'
bench-local'
],
node_title
=
args
.
test_node_title
,
test_title
=
args
.
test_suite_title
or
args
.
test_suite
,
project_title
=
args
.
project_title
)
...
...
@@ -76,7 +76,8 @@ def main():
break
# run `neotest <test-name>`
argv
=
[
'neotest'
,
test_result_line
.
name
]
testname
=
test_result_line
.
name
argv
=
[
'neotest'
,
testname
]
tstart
=
time
()
try
:
...
...
@@ -102,8 +103,31 @@ def main():
p
.
wait
()
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
test_result_line
.
stop
(
...
...
@@ -114,11 +138,7 @@ def main():
stdout
=
stdout
,
stderr
=
stderr
,
test_count
=
1
,
error_count
=
(
0
if
ok
else
1
),
failure_count
=
0
,
skip_count
=
0
,
#html_test_result
**
status
)
# 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):
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__'
:
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