Documentation
¶
Overview ¶
Package conformance is the cross-engine behaviour suite for project drivers. Every case talks to a driver only through interfaces.ProjectDBInterface, and every engine runs the same cases against a real server. SQLite always runs; server engines run when their URL env var is set (see EngineFactories) and are skipped otherwise, so `go test ./...` stays offline.
Index ¶
Constants ¶
const ( EnvPostgres = "CONFORMANCE_POSTGRES_URL" // postgres://user:pass@host:port/shared_db EnvMySQL = "CONFORMANCE_MYSQL_URL" // mysql://user:pass@host:port EnvMariaDB = "CONFORMANCE_MARIADB_URL" // mysql://user:pass@host:port EnvMongo = "CONFORMANCE_MONGO_URL" // mongodb://user:pass@host:port )
Env vars that enable server engines.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
type Factory struct {
Name string
// Skip is non-empty when this engine is not configured.
Skip string
// KnownGaps lists cases the engine does not implement yet (case → reason).
// They are reported as skips, which makes the list a checklist.
KnownGaps map[string]string
Open func(t *testing.T) *Opened
}
Factory opens isolated project databases for one engine variant.
func EngineFactories ¶
func EngineFactories() []Factory
EngineFactories returns every engine variant opened with the open_driver constructors; unconfigured ones carry Skip.
func EngineFactoriesWith ¶
EngineFactoriesWith is EngineFactories with a custom opener (nil = default).
type OpenFunc ¶
type OpenFunc func(cfg *models.Config, cred *models.DriverCredentials) (interfaces.ProjectDBInterface, error)
OpenFunc opens a project driver for credentials. The default uses the open_driver constructors; the engine passes its production driver factory so the same cases run through the exact boot path (Pro wrappers included).
type Opened ¶
type Opened struct {
Driver interfaces.ProjectDBInterface
ProjectID string
Cred *models.DriverCredentials
// Raw is an admin handle on the same database for assertions that need
// to look at physical state (SQL engines only; nil for Mongo).
Raw *sql.DB
// Dialect is "sqlite", "postgresql", "mysql", "mariadb" or "mongodb".
Dialect string
// Schema is set for the Postgres schema-isolation variant.
Schema string
}
Opened is one fresh, isolated project database.