Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
0
Merge Requests
0
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
Levin Zimmermann
neoppod
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 {
...
@@ -76,11 +76,11 @@ type NEOSrvOptions struct {
//
//
// Create it with StartNEOPySrv.
// Create it with StartNEOPySrv.
type
NEOPySrv
struct
{
type
NEOPySrv
struct
{
pysrv
*
xexec
.
Cmd
// spawned `runneo.py`
pysrv
*
xexec
.
Cmd
// spawned `runneo.py`
opt
NEOSrvOptions
// options for spawned server
opt
NEOSrvOptions
// options for spawned server
cancel
func
()
// to stop pysrv
cancel
func
()
// to stop pysrv
done
chan
struct
{}
// ready after Wait completes
done
chan
struct
{}
// ready after Wait completes
errExit
error
// error from Wait
errExit
error
// error from Wait
masterAddr
string
// address of master in spawned cluster
masterAddr
string
// address of master in spawned cluster
}
}
...
@@ -111,7 +111,7 @@ func StartNEOPySrv(opt NEOSrvOptions) (_ *NEOPySrv, err error) {
...
@@ -111,7 +111,7 @@ func StartNEOPySrv(opt NEOSrvOptions) (_ *NEOPySrv, err error) {
n
:=
&
NEOPySrv
{
opt
:
opt
,
cancel
:
cancel
,
done
:
make
(
chan
struct
{})}
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
)
n
.
pysrv
=
xexec
.
Command
(
"./py/runneo.py"
,
workdir
,
opt
.
name
)
if
opt
.
SSL
{
if
opt
.
SSL
{
n
.
pysrv
.
Args
=
append
(
n
.
pysrv
.
Args
,
"ca="
+
opt
.
CA
())
n
.
pysrv
.
Args
=
append
(
n
.
pysrv
.
Args
,
"ca="
+
opt
.
CA
())
...
@@ -226,8 +226,6 @@ func (_ *NEOGoSrv) BugEncFixed() (bool, proto.Encoding) {
...
@@ -226,8 +226,6 @@ func (_ *NEOGoSrv) BugEncFixed() (bool, proto.Encoding) {
func
StartNEOGoSrv
(
opt
NEOSrvOptions
)
(
_
*
NEOGoSrv
,
err
error
)
{
func
StartNEOGoSrv
(
opt
NEOSrvOptions
)
(
_
*
NEOGoSrv
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"start neo/go %s/%s"
,
opt
.
workdir
,
opt
.
name
)
defer
xerr
.
Contextf
(
&
err
,
"start neo/go %s/%s"
,
opt
.
workdir
,
opt
.
name
)
// XXX release resources on error
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
serveWG
:=
xsync
.
NewWorkGroup
(
ctx
)
serveWG
:=
xsync
.
NewWorkGroup
(
ctx
)
...
@@ -288,7 +286,6 @@ func StartNEOGoSrv(opt NEOSrvOptions) (_ *NEOGoSrv, err error) {
...
@@ -288,7 +286,6 @@ func StartNEOGoSrv(opt NEOSrvOptions) (_ *NEOGoSrv, err error) {
}
}
return
n
,
nil
return
n
,
nil
}
}
func
(
n
*
NEOGoSrv
)
Close
()
(
err
error
)
{
func
(
n
*
NEOGoSrv
)
Close
()
(
err
error
)
{
...
@@ -372,7 +369,6 @@ func (opt NEOSrvOptions) URLPrefix() string {
...
@@ -372,7 +369,6 @@ func (opt NEOSrvOptions) URLPrefix() string {
// ----------------
// ----------------
// tOptions represents options for testing.
// tOptions represents options for testing.
// XXX dup in ZEO
type
tOptions
struct
{
type
tOptions
struct
{
Preload
string
// preload database with data from this location
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
...
@@ -445,7 +441,7 @@ func withNEOSrv(t *testing.T, f func(t *testing.T, nsrv NEOSrv), optv ...tOption
// NEO/py
// NEO/py
t
.
Run
(
"py/"
+
kind
,
func
(
t
*
testing
.
T
)
{
t
.
Run
(
"py/"
+
kind
,
func
(
t
*
testing
.
T
)
{
t
.
Helper
()
t
.
Helper
()
//
XXX needpy
//
TODO t.NeedPy(...)
inWorkDir
(
t
,
func
(
workdir
string
)
{
inWorkDir
(
t
,
func
(
workdir
string
)
{
X
:=
xtesting
.
FatalIf
(
t
)
X
:=
xtesting
.
FatalIf
(
t
)
...
@@ -581,7 +577,7 @@ func withNEO(t *testing.T, f func(t *testing.T, nsrv NEOSrv, ndrv *Client), optv
...
@@ -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
)
{
func
TestEmptyDB
(
t
*
testing
.
T
)
{
withNEO
(
t
,
func
(
t
*
testing
.
T
,
nsrv
NEOSrv
,
n
*
Client
)
{
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