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
@@ -1,12 +1,51 @@
|
||||
package store_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"pageswiki/internal/db"
|
||||
"pageswiki/internal/store"
|
||||
)
|
||||
|
||||
func TestPortablePathLookupPreservesLegacyContract(t *testing.T) {
|
||||
database, err := db.Open(t.TempDir() + "/pages.db")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer database.Close()
|
||||
if err := db.Migrate(database); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
st := store.New(database)
|
||||
domain, err := st.GetDefaultDomain()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
id, err := st.CreatePageAtPathInDomain(domain.UUID, "/日本語%_/本")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got, err := st.ResolvePathInDomainContext(context.Background(), domain.UUID, " 日本語%_/本/ ")
|
||||
if err != nil || got != id {
|
||||
t.Fatal("legacy normalization changed", err)
|
||||
}
|
||||
if _, err := st.ResolvePathInDomainContext(context.Background(), domain.UUID, "/missing"); !errors.Is(err, sql.ErrNoRows) {
|
||||
t.Fatal("legacy missing-path error changed", err)
|
||||
}
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
if _, err := st.ResolvePathInDomainContext(ctx, domain.UUID, "/日本語%_/本"); !errors.Is(err, context.Canceled) {
|
||||
t.Fatal("lookup cancellation lost", err)
|
||||
}
|
||||
var count int
|
||||
if err := database.QueryRow(`SELECT count(*) FROM schema_migration_steps WHERE component='core-metadata'`).Scan(&count); err != nil || count != 0 {
|
||||
t.Fatal("portable bootstrap was invoked on legacy schema", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestObjectIdentityIsIndependentFromSemanticPath(t *testing.T) {
|
||||
database, err := db.Open(t.TempDir() + "/pages.db")
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user