fixtures

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSchema

func LoadSchema(ctx context.Context, dsn string) error

LoadSchema runs database migrations using fern-reporter's embedded migration files

func SeedFlakyTests

func SeedFlakyTests(ctx context.Context, dsn string) error
func LoadSchema(ctx context.Context, db *pgxpool.Pool) error {
	driver, _ := postgres.WithInstance(db, &postgres.Config{})
	source, _ := iofs.New(fernmigrations.Migrations, ".")
	m, _ := migrate.NewWithInstance("iofs", source, "postgres", driver)
	return m.Up()
	// path, _ := filepath.Abs("fixtures/schema.sql")
	// schemaBytes, err := os.ReadFile(path)
	// if err != nil {
	// 	return err
	// }
	// _, err = db.Exec(ctx, string(schemaBytes))
	// return err
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL