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
28a13ef9
Commit
28a13ef9
authored
Jul 06, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e2b740aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
go/zodb/storage/zeo/zeo_test.go
go/zodb/storage/zeo/zeo_test.go
+18
-7
No files found.
go/zodb/storage/zeo/zeo_test.go
View file @
28a13ef9
...
@@ -163,6 +163,7 @@ func withZEOSrv(t *testing.T, f func(t *testing.T, zsrv ZEOSrv), optv ...tOption
...
@@ -163,6 +163,7 @@ func withZEOSrv(t *testing.T, f func(t *testing.T, zsrv ZEOSrv), optv ...tOption
// withFS1 runs f under environment with new FileStorage database.
// withFS1 runs f under environment with new FileStorage database.
withFS1
:=
func
(
t
*
testing
.
T
,
f
func
(
fs1path
string
))
{
withFS1
:=
func
(
t
*
testing
.
T
,
f
func
(
fs1path
string
))
{
t
.
Helper
()
X
:=
mkFatalIf
(
t
)
X
:=
mkFatalIf
(
t
)
work
:=
xtempdir
(
t
)
work
:=
xtempdir
(
t
)
defer
os
.
RemoveAll
(
work
)
defer
os
.
RemoveAll
(
work
)
...
@@ -179,6 +180,7 @@ func withZEOSrv(t *testing.T, f func(t *testing.T, zsrv ZEOSrv), optv ...tOption
...
@@ -179,6 +180,7 @@ func withZEOSrv(t *testing.T, f func(t *testing.T, zsrv ZEOSrv), optv ...tOption
for
_
,
msgpack
:=
range
[]
bool
{
false
,
true
}
{
for
_
,
msgpack
:=
range
[]
bool
{
false
,
true
}
{
// ZEO/py
// ZEO/py
t
.
Run
(
fmt
.
Sprintf
(
"py/msgpack=%v"
,
msgpack
),
func
(
t
*
testing
.
T
)
{
t
.
Run
(
fmt
.
Sprintf
(
"py/msgpack=%v"
,
msgpack
),
func
(
t
*
testing
.
T
)
{
t
.
Helper
()
needZEOpy
(
t
)
needZEOpy
(
t
)
withFS1
(
t
,
func
(
fs1path
string
)
{
withFS1
(
t
,
func
(
fs1path
string
)
{
X
:=
mkFatalIf
(
t
)
X
:=
mkFatalIf
(
t
)
...
@@ -196,6 +198,21 @@ func withZEOSrv(t *testing.T, f func(t *testing.T, zsrv ZEOSrv), optv ...tOption
...
@@ -196,6 +198,21 @@ func withZEOSrv(t *testing.T, f func(t *testing.T, zsrv ZEOSrv), optv ...tOption
}
}
}
}
// withZEO tests f on all kinds of ZEO servers connected to by ZEO client.
func
withZEO
(
t
*
testing
.
T
,
f
func
(
t
*
testing
.
T
,
zdrv
*
zeo
),
optv
...
tOptions
)
{
t
.
Helper
()
withZEOSrv
(
t
,
func
(
t
*
testing
.
T
,
zsrv
ZEOSrv
)
{
t
.
Helper
()
X
:=
mkFatalIf
(
t
)
zdrv
,
_
,
err
:=
zeoOpen
(
zsrv
.
Addr
(),
&
zodb
.
DriverOptions
{
ReadOnly
:
true
});
X
(
err
)
defer
func
()
{
err
:=
zdrv
.
Close
();
X
(
err
)
}()
f
(
t
,
zdrv
)
},
optv
...
)
}
func
TestHandshake
(
t
*
testing
.
T
)
{
func
TestHandshake
(
t
*
testing
.
T
)
{
X
:=
mkFatalIf
(
t
)
X
:=
mkFatalIf
(
t
)
withZEOSrv
(
t
,
func
(
t
*
testing
.
T
,
zsrv
ZEOSrv
)
{
withZEOSrv
(
t
,
func
(
t
*
testing
.
T
,
zsrv
ZEOSrv
)
{
...
@@ -219,14 +236,8 @@ func TestLoad(t *testing.T) {
...
@@ -219,14 +236,8 @@ func TestLoad(t *testing.T) {
fs1data
:=
"../fs1/testdata/1.fs"
fs1data
:=
"../fs1/testdata/1.fs"
txnvOk
,
err
:=
xtesting
.
LoadDB
(
fs1data
);
X
(
err
)
txnvOk
,
err
:=
xtesting
.
LoadDB
(
fs1data
);
X
(
err
)
withZEOSrv
(
t
,
func
(
t
*
testing
.
T
,
zsrv
ZEOSrv
)
{
withZEO
(
t
,
func
(
t
*
testing
.
T
,
z
*
zeo
)
{
z
,
_
,
err
:=
zeoOpen
(
zsrv
.
Addr
(),
&
zodb
.
DriverOptions
{
ReadOnly
:
true
});
X
(
err
)
defer
func
()
{
err
:=
z
.
Close
();
X
(
err
)
}()
xtesting
.
DrvTestLoad
(
t
,
z
,
txnvOk
)
xtesting
.
DrvTestLoad
(
t
,
z
,
txnvOk
)
},
tOptions
{
},
tOptions
{
Preload
:
fs1data
,
Preload
:
fs1data
,
})
})
...
...
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