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
c1f63a6b
Commit
c1f63a6b
authored
Oct 18, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c1a7c85a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
19 deletions
+21
-19
go/neo/client_test.go
go/neo/client_test.go
+16
-15
go/neo/py/runneo.py
go/neo/py/runneo.py
+5
-4
No files found.
go/neo/client_test.go
View file @
c1f63a6b
...
...
@@ -45,14 +45,15 @@ type NEOSrv interface {
//
// Create it with StartNEOPySrv(XXX).
type
NEOPySrv
struct
{
pysrv
*
exec
.
Cmd
// spawned `XXX`
workdir
string
// location for database and log files
opt
NEOPyOptions
// options for spawned server
cancel
func
()
// to stop pysrv
done
chan
struct
{}
// ready after Wait completes
errExit
error
// error from Wait
masterAddr
string
// address of master in spawned cluster
pysrv
*
exec
.
Cmd
// spawned `runneo.py`
workdir
string
// location for database and log files
clusterName
string
// name of the cluster
opt
NEOPyOptions
// options for spawned server
cancel
func
()
// to stop pysrv
done
chan
struct
{}
// ready after Wait completes
errExit
error
// error from Wait
masterAddr
string
// address of master in spawned cluster
}
// NEOPySrv.Bugs
...
...
@@ -65,10 +66,10 @@ type NEOPyOptions struct {
// name
}
// StartNEOPySrv starts NEO/py server for NEO database located in workdir/.
// StartNEOPySrv starts NEO/py server for
clusterName
NEO database located in workdir/.
// XXX dup wrt zeo?
func
StartNEOPySrv
(
workdir
string
,
opt
NEOPyOptions
)
(
_
*
NEOPySrv
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"startneo %s
"
,
workdir
)
func
StartNEOPySrv
(
workdir
,
clusterName
string
,
opt
NEOPyOptions
)
(
_
*
NEOPySrv
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"startneo %s
/%s"
,
workdir
,
clusterName
)
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
...
...
@@ -81,8 +82,8 @@ func StartNEOPySrv(workdir string, opt NEOPyOptions) (_ *NEOPySrv, err error) {
return
nil
,
err
}
n
:=
&
NEOPySrv
{
workdir
:
workdir
,
cancel
:
cancel
,
done
:
make
(
chan
struct
{})}
n
.
pysrv
=
exec
.
CommandContext
(
ctx
,
"python"
,
"./py/runneo.py"
,
workdir
)
// XXX +opt
n
:=
&
NEOPySrv
{
workdir
:
workdir
,
c
lusterName
:
clusterName
,
c
ancel
:
cancel
,
done
:
make
(
chan
struct
{})}
n
.
pysrv
=
exec
.
CommandContext
(
ctx
,
"python"
,
"./py/runneo.py"
,
workdir
,
clusterName
)
// XXX +opt
n
.
opt
=
opt
// $TEMP -> workdir (else NEO/py creates another one for e.g. coverage)
n
.
pysrv
.
Env
=
append
(
os
.
Environ
(),
"TEMP="
+
workdir
)
...
...
@@ -136,7 +137,7 @@ func StartNEOPySrv(workdir string, opt NEOPyOptions) (_ *NEOPySrv, err error) {
}
func
(
n
*
NEOPySrv
)
ClusterName
()
string
{
return
"xxx"
// FIXME stub
return
n
.
clusterName
}
func
(
n
*
NEOPySrv
)
MasterAddr
()
string
{
...
...
@@ -198,7 +199,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
inWorkDir
(
t
,
func
(
workdir
string
)
{
X
:=
xtesting
.
FatalIf
(
t
)
npy
,
err
:=
StartNEOPySrv
(
workdir
,
NEOPyOptions
{});
X
(
err
)
npy
,
err
:=
StartNEOPySrv
(
workdir
,
"1"
,
NEOPyOptions
{});
X
(
err
)
defer
func
()
{
err
:=
npy
.
Close
();
X
(
err
)
}()
...
...
go/neo/py/runneo.py
View file @
c1f63a6b
...
...
@@ -19,7 +19,7 @@
# See https://www.nexedi.com/licensing for rationale and options.
"""runneo.py runs NEO/py cluster for NEO/go testing.
Usage: runneo
py <workdir> <readyfil
e> XXX + (**kw for NEOCluster)
Usage: runneo
.py <workdir> <cluster-nam
e> XXX + (**kw for NEOCluster)
XXX
"""
...
...
@@ -32,10 +32,11 @@ from time import sleep
@
func
def
main
():
workdir
=
sys
.
argv
[
1
]
readyf
=
workdir
+
"/ready"
workdir
=
sys
.
argv
[
1
]
clusterName
=
sys
.
argv
[
2
]
readyf
=
workdir
+
"/ready"
cluster
=
NEOCluster
([
'1'
],
adapter
=
'SQLite'
,
temp_dir
=
workdir
)
# XXX +kw
cluster
=
NEOCluster
([
clusterName
],
adapter
=
'SQLite'
,
temp_dir
=
workdir
)
# XXX +kw
cluster
.
start
()
defer
(
cluster
.
stop
)
...
...
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