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
a1ceb162
Commit
a1ceb162
authored
Mar 17, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2a95e448
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
go/zodb/storage/demo/demo_test.go
go/zodb/storage/demo/demo_test.go
+27
-4
No files found.
go/zodb/storage/demo/demo_test.go
View file @
a1ceb162
...
@@ -169,27 +169,50 @@ func TestWatch(t *testing.T) {
...
@@ -169,27 +169,50 @@ func TestWatch(t *testing.T) {
})
})
}
}
// withDemoBaseMutated tests f with demo: client connected to Storage and base
//
TestBaseMutate verifies that demo detect if base mutates
.
//
just mutated with new commit
.
func
TestBaseMutate
(
t
*
testing
.
T
)
{
func
withDemoBaseMutated
(
t
*
testing
.
T
,
f
func
(
t
*
testing
.
T
,
ddrv
*
Storage
)
)
{
withDemo
(
t
,
func
(
t
*
testing
.
T
,
ddat
*
DemoData
,
ddrv
*
Storage
)
{
withDemo
(
t
,
func
(
t
*
testing
.
T
,
ddat
*
DemoData
,
ddrv
*
Storage
)
{
X
:=
xtesting
.
FatalIf
(
t
)
X
:=
xtesting
.
FatalIf
(
t
)
/* XXX kill?
head, err := ddrv.Sync(context.Background())
head, err := ddrv.Sync(context.Background())
if !(head == 0 && err == nil) {
if !(head == 0 && err == nil) {
t.Fatalf("sync0: head=%s err=%s", head, err)
t.Fatalf("sync0: head=%s err=%s", head, err)
}
}
*/
_
,
err
=
xtesting
.
ZPyCommitRaw
(
ddat
.
base
,
0
,
xtesting
.
ZRawObject
{
_
,
err
=
xtesting
.
ZPyCommitRaw
(
ddat
.
base
,
0
,
xtesting
.
ZRawObject
{
Oid
:
1
,
Oid
:
1
,
Data
:
[]
byte
(
"ZZZ"
),
Data
:
[]
byte
(
"ZZZ"
),
});
X
(
err
)
});
X
(
err
)
head
,
err
=
ddrv
.
Sync
(
context
.
Background
())
f
(
t
,
ddrv
)
})
}
// TestSync_vs_BaseMutate verifies Sync wrt base mutation.
func
TestSync_vs_BaseMutate
(
t
*
testing
.
T
)
{
withDemoBaseMutated
(
t
,
func
(
t
*
testing
.
T
,
ddrv
*
Storage
)
{
X
:=
xtesting
.
FatalIf
(
t
)
head
,
err
:=
ddrv
.
Sync
(
context
.
Background
())
// XXX verify err
})
}
// TestWatchLoad_vs_BaseMutate verifies Watch and Load wrt base mutation.
func
TestLoad_vs_BaseMutate
(
t
*
testing
.
T
)
{
withDemoBaseMutated
(
t
,
func
(
t
*
testing
.
T
,
ddrv
*
Storage
)
{
X
:=
xtesting
.
FatalIf
(
t
)
// XXX first wait for error from watchq
data
,
serial
,
err
:=
ddrv
.
Load
(
context
.
Background
(),
...
)
// XXX verify err
// XXX verify err
})
})
}
}
func
demoOpen
(
zurl
string
,
opt
*
zodb
.
DriverOptions
)
(
_
*
Storage
,
at0
zodb
.
Tid
,
err
error
)
{
func
demoOpen
(
zurl
string
,
opt
*
zodb
.
DriverOptions
)
(
_
*
Storage
,
at0
zodb
.
Tid
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"opendemo %s"
,
zurl
)
defer
xerr
.
Contextf
(
&
err
,
"opendemo %s"
,
zurl
)
u
,
err
:=
url
.
Parse
(
zurl
)
u
,
err
:=
url
.
Parse
(
zurl
)
...
...
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