Documentation
¶
Index ¶
- func AssertFailed(t *testing.T, db *bun.DB, source string)
- func AssertFailedWithWatermark(t *testing.T, db *bun.DB, source string, want time.Time)
- func AssertSucceededAfter(t *testing.T, db *bun.DB, source string, previous time.Time)
- func ConfigTime(t *testing.T, db *bun.DB, column string) time.Time
- func ConfigTimeIsNull(t *testing.T, db *bun.DB, column string) bool
- func CreateFriendsOfPHPTable(t *testing.T, db *bun.DB)
- func CreatePackageLinkIndexes(t *testing.T, db *bun.DB)
- func CreateTables(t *testing.T, db *bun.DB, models ...any)
- func DropTable(t *testing.T, db *bun.DB, table string)
- func SeedWatermark(t *testing.T, db *bun.DB, source string, watermark time.Time)
- func SetConfigTime(t *testing.T, db *bun.DB, column string, value time.Time)
- func SetupBuildTestDBs(t *testing.T) (knowledgeDB, configDB *bun.DB)
- func SetupKnowledgeAndConfigTestDB(t *testing.T) (*bun.DB, *bun.DB, func())
- func SetupKnowledgeTestDB(t *testing.T) (*bun.DB, func())
- func SetupSyncTestDB(t *testing.T) *bun.DB
- func UpstreamTotal(t *testing.T, db *bun.DB, source string) *int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertFailed ¶
AssertFailed checks that source's last run is recorded as a failure.
func AssertFailedWithWatermark ¶
AssertFailedWithWatermark checks that source failed and its watermark is still want.
func AssertSucceededAfter ¶
AssertSucceededAfter checks that source succeeded and its watermark moved past previous.
func ConfigTime ¶
ConfigTime reads one timestamp column of the config row.
func ConfigTimeIsNull ¶
ConfigTimeIsNull reports whether a timestamp column of the config row is unset.
func CreateFriendsOfPHPTable ¶
CreateFriendsOfPHPTable creates friends_of_php as the API migrations leave it.
func CreatePackageLinkIndexes ¶
CreatePackageLinkIndexes adds the unique indexes that package link upserts target.
func CreateTables ¶
CreateTables creates one table per bun model in the test schema, skipping tables that exist. Sources that share a table, such as package_vulnerability, can each create it.
func SeedWatermark ¶
SeedWatermark stores a known starting watermark for source.
func SetConfigTime ¶
SetConfigTime writes one timestamp column of the config row, as another writer would.
func SetupBuildTestDBs ¶
SetupBuildTestDBs opens knowledge and config schemas like a migrated empty install: null watermarks everywhere. Tests record applied migrations themselves.
func SetupKnowledgeAndConfigTestDB ¶
SetupKnowledgeAndConfigTestDB sets up both knowledge and config database connections for testing
func SetupKnowledgeTestDB ¶
SetupKnowledgeTestDB sets up a knowledge database connection for testing
func SetupSyncTestDB ¶
SetupSyncTestDB opens a fresh schema in the throwaway database named by KNOWLEDGE_SYNC_TEST_DSN, holding the source sync and config tables.
Types ¶
This section is empty.