feat(storage): add native PostgreSQL runtime and verified offline application import
Build and publish container images / images (push) Failing after 12m29s
Build and publish container images / images (push) Failing after 12m29s
This commit is contained in:
1 parent
96065d1e89
commit
0ba1dcfef0
243 files changed
+21441
-3090
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRecentObjectsBackend(t *testing.T) {
|
||||
for _, backend := range []storeSQLBackend{storeSQLite, storePostgreSQL} {
|
||||
t.Run(fmt.Sprint(backend), func(t *testing.T) {
|
||||
f := newPublicationBackend(t, backend)
|
||||
s := f.s
|
||||
f.page("older", "/older", "old-rev", 1000)
|
||||
f.page("newer", "/newer", "new-rev", 2000)
|
||||
f.exec(`INSERT INTO paths(domain_uuid,path,object_uuid,created_at,is_primary) VALUES(`+s.sqlValues(5)+`)`, f.domain, "/preferred", "newer", 1, 1)
|
||||
f.exec(`INSERT INTO paths(domain_uuid,path,object_uuid,created_at,is_primary) VALUES(`+s.sqlValues(5)+`)`, "other", "/elsewhere", "older", 1, 1)
|
||||
items, err := s.ListRecentObjectsInDomain(f.domain, 20)
|
||||
if err != nil || len(items) != 2 || items[0].UUID != "newer" || items[0].Path != "/preferred" || items[1].Path != "/older" {
|
||||
t.Fatal(items, err)
|
||||
}
|
||||
items, err = s.ListRecentObjectsInDomain("other", 20)
|
||||
if err != nil || len(items) != 1 || items[0].Path != "/elsewhere" {
|
||||
t.Fatal(items, err)
|
||||
}
|
||||
items, err = s.ListRecentObjectsInDomain(f.domain, 1)
|
||||
if err != nil || len(items) != 1 || items[0].UUID != "newer" {
|
||||
t.Fatal(items, err)
|
||||
}
|
||||
items, err = s.ListRecentObjectsInDomain("missing", 20)
|
||||
if err != nil || len(items) != 0 {
|
||||
t.Fatal(items, err)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user