Commit e76c9501 authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb/demo: Test it on all py2/py3 ZODB kinds of data we care about

Similarly to FileStorage, fs1tools and zodbtools previously we were testing
demo only with old FileStorage testdata generated by python2 and pickle
protocol=2. However even on py2 there are more pickle protocols that
are in use, and also there is python3.

-> Adjust demo testing to automatically load and test agains all ZODB
kinds from recently updated FileStorage testdata.

All py2_pickle1, py2_pickle2, py2_pickle3 and py3_pickle3 are handled well out of the box.
parent c67e2fec
// Copyright (C) 2021 Nexedi SA and Contributors.
// Copyright (C) 2021-2024 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
......@@ -160,10 +160,21 @@ func TestEmptyDB(t *testing.T) {
})
}
// ztestdataReg keeps registry of ZODB test data we use in tests with non-empty Preload.
// we take the data from fs1 testdata.
var ztestdataReg = xtesting.ZTestDataRegistry[struct{}]{}
type ZTestData = xtesting.ZTestData[struct{}]
func init() {
ztestdataReg = xtesting.LoadZTestData("../fs1/testdata")
}
func TestLoad(t *testing.T) {
ztestdataReg.RunWithEach(t, _TestLoad)
}
func _TestLoad(t *testing.T, z *ZTestData) {
X := xtesting.FatalIf(t)
data := "../fs1/testdata/1.fs"
data := z.Path("1.fs")
txnvOk, err := xtesting.LoadDBHistory(data); X(err)
withDemo(t, func(t *testing.T, _ *DemoData, ddrv *Storage) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment