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
bad63742
Commit
bad63742
authored
Feb 19, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e420f6f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
go/neo/client_test.go
go/neo/client_test.go
+8
-12
No files found.
go/neo/client_test.go
View file @
bad63742
...
...
@@ -76,11 +76,11 @@ type NEOSrvOptions struct {
//
// Create it with StartNEOPySrv.
type
NEOPySrv
struct
{
pysrv
*
xexec
.
Cmd
// spawned `runneo.py`
opt
NEOSrvOptions
// options for spawned server
cancel
func
()
// to stop pysrv
done
chan
struct
{}
// ready after Wait completes
errExit
error
// error from Wait
pysrv
*
xexec
.
Cmd
// spawned `runneo.py`
opt
NEOSrvOptions
// 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
}
...
...
@@ -111,7 +111,7 @@ func StartNEOPySrv(opt NEOSrvOptions) (_ *NEOPySrv, err error) {
n
:=
&
NEOPySrv
{
opt
:
opt
,
cancel
:
cancel
,
done
:
make
(
chan
struct
{})}
//
XXX $PYTHONPATH to top, so that `import neo` works?
//
TODO set $PYTHONPATH to top, so that `import neo` works without `pip install -e .`
n
.
pysrv
=
xexec
.
Command
(
"./py/runneo.py"
,
workdir
,
opt
.
name
)
if
opt
.
SSL
{
n
.
pysrv
.
Args
=
append
(
n
.
pysrv
.
Args
,
"ca="
+
opt
.
CA
())
...
...
@@ -226,8 +226,6 @@ func (_ *NEOGoSrv) BugEncFixed() (bool, proto.Encoding) {
func
StartNEOGoSrv
(
opt
NEOSrvOptions
)
(
_
*
NEOGoSrv
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"start neo/go %s/%s"
,
opt
.
workdir
,
opt
.
name
)
// XXX release resources on error
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
serveWG
:=
xsync
.
NewWorkGroup
(
ctx
)
...
...
@@ -288,7 +286,6 @@ func StartNEOGoSrv(opt NEOSrvOptions) (_ *NEOGoSrv, err error) {
}
return
n
,
nil
}
func
(
n
*
NEOGoSrv
)
Close
()
(
err
error
)
{
...
...
@@ -372,7 +369,6 @@ func (opt NEOSrvOptions) URLPrefix() string {
// ----------------
// tOptions represents options for testing.
// XXX dup in ZEO
type
tOptions
struct
{
Preload
string
// preload database with data from this location
}
...
...
@@ -445,7 +441,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
// NEO/py
t
.
Run
(
"py/"
+
kind
,
func
(
t
*
testing
.
T
)
{
t
.
Helper
()
//
XXX needpy
//
TODO t.NeedPy(...)
inWorkDir
(
t
,
func
(
workdir
string
)
{
X
:=
xtesting
.
FatalIf
(
t
)
...
...
@@ -581,7 +577,7 @@ func withNEO(t *testing.T, f func(t *testing.T, nsrv NEOSrv, ndrv *Client), optv
}
// TODO connect with wrong clusterName -> rejected
// TODO
verify:
connect with wrong clusterName -> rejected
func
TestEmptyDB
(
t
*
testing
.
T
)
{
withNEO
(
t
,
func
(
t
*
testing
.
T
,
nsrv
NEOSrv
,
n
*
Client
)
{
...
...
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