- Add comprehensive test suite for Store interface - Test schema initialization, revisions, options, search, declarations, files - SQLite tests use in-memory database for speed - PostgreSQL tests require TEST_POSTGRES_CONN environment variable Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
22 lines
408 B
Go
22 lines
408 B
Go
package database
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestPostgresStore(t *testing.T) {
|
|
connStr := os.Getenv("TEST_POSTGRES_CONN")
|
|
if connStr == "" {
|
|
t.Skip("TEST_POSTGRES_CONN not set, skipping PostgreSQL tests")
|
|
}
|
|
|
|
runStoreTests(t, func(t *testing.T) Store {
|
|
store, err := NewPostgresStore(connStr)
|
|
if err != nil {
|
|
t.Fatalf("Failed to create PostgreSQL store: %v", err)
|
|
}
|
|
return store
|
|
})
|
|
}
|