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
321027be
Commit
321027be
authored
Sep 25, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
67b0680c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
33 deletions
+32
-33
go/neo/t/nxd/.nxdtest
go/neo/t/nxd/.nxdtest
+28
-2
go/neo/t/nxd/nxdtest
go/neo/t/nxd/nxdtest
+4
-31
No files found.
go/neo/t/nxd/.nxdtest
View file @
321027be
# setup for continous integration via nxdtes
# setup to run neotest on Nexedi testing infrastructure.
# https://stack.nexedi.com/test_status
# 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*summary.*$', 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),
}
TestCase('test-go', ['neotest', 'test-go'])
TestCase('test-go', ['neotest', 'test-go'])
TestCase('test-py', ['neotest', 'test-py'])
TestCase('test-py', ['neotest', 'test-py']
, summaryf=test_py_summary
)
TestCase('bench-local', ['neotest', 'bench-local'])
TestCase('bench-local', ['neotest', 'bench-local'])
go/neo/t/nxd/nxdtest
View file @
321027be
...
@@ -43,10 +43,11 @@ def loadNXDTestFile(path): # -> TestEnv
...
@@ -43,10 +43,11 @@ def loadNXDTestFile(path): # -> TestEnv
# TestCase defines one test case to run.
# TestCase defines one test case to run.
class
TestCase
:
class
TestCase
:
def
__init__
(
self
,
name
,
argv
,
**
kw
):
def
__init__
(
self
,
name
,
argv
,
summaryf
=
None
,
**
kw
):
self
.
name
=
name
self
.
name
=
name
self
.
argv
=
argv
self
.
argv
=
argv
self
.
kw
=
kw
self
.
kw
=
kw
self
.
summaryf
=
summaryf
# TestEnv represents a testing environment with set of TestCases to run.
# TestEnv represents a testing environment with set of TestCases to run.
class
TestEnv
:
class
TestEnv
:
...
@@ -157,10 +158,9 @@ def main():
...
@@ -157,10 +158,9 @@ def main():
status
[
'error_count'
]
+=
1
status
[
'error_count'
]
+=
1
# postprocess output, if we can
# postprocess output, if we can
summaryf
=
globals
().
get
(
t
.
name
.
replace
(
'-'
,
'_'
)
+
'_summary'
)
if
t
.
summaryf
is
not
None
:
if
summaryf
is
not
None
:
try
:
try
:
summary
=
summaryf
(
stdout
)
summary
=
t
.
summaryf
(
stdout
)
except
:
except
:
bad
=
traceback
.
format_exc
()
bad
=
traceback
.
format_exc
()
sys
.
stderr
.
write
(
bad
)
sys
.
stderr
.
write
(
bad
)
...
@@ -237,32 +237,5 @@ class LocalTestResultLine:
...
@@ -237,32 +237,5 @@ class LocalTestResultLine:
print
(
'%s
\
t
%s
\
t
%.3fs
\
t
# %st %se %sf %ss'
%
(
st
,
self
.
name
,
kw
[
'duration'
],
v
(
'test_count'
),
v
(
'error_count'
),
v
(
'failure_count'
),
v
(
'skip_count'
)))
print
(
'%s
\
t
%s
\
t
%.3fs
\
t
# %st %se %sf %ss'
%
(
st
,
self
.
name
,
kw
[
'duration'
],
v
(
'test_count'
),
v
(
'error_count'
),
v
(
'failure_count'
),
v
(
'skip_count'
)))
# 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