testconfig

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRTJsons added in v1.4.1

func AddRTJsons(ctx context.Context, rtf model.RTFinder, now time.Time, files []RTJsonFile) error

AddRTJsons adds realtime fixtures from testdata/server/rt to an RTFinder. Each is served as a live feed's payload: fetched its Age before now, with its header stamped then.

func Config

func Config(t testing.TB, opts Options) model.Config

func ConfigTx

func ConfigTx(t testing.TB, opts Options, cb func(model.Config) error)

func ConfigTxRollback

func ConfigTxRollback(t testing.TB, opts Options, cb func(model.Config))

func SupplementalSha1 added in v1.4.1

func SupplementalSha1(t testing.TB, cfg model.Config) string

SupplementalSha1 returns the sha1 of the supplemental fixture feed's only version, as the config's finder finds it by the feed's onestop id. The sha1 changes with each edit to testdata/server/gtfs/supplemental.zip.

Types

type Options

type Options struct {
	WhenUtc        string
	Storage        string
	RTStorage      string
	RTJsons        []RTJsonFile
	FGAEndpoint    string
	FGAModelFile   string
	FGAModelTuples []authz.TupleKey
	// AllowAll installs an AllowAllChecker. Required for tests that exercise
	// mutations. Ignored when FGAEndpoint is set.
	AllowAll bool
	// UseGeohashFilter enables the secondary stop-geohash filter on bbox/within/near
	// queries. Requires the test database to have tl_feed_version_geohashes populated.
	UseGeohashFilter bool
	// UseMaterializedDepartures plans departure queries from a materialized CTE.
	UseMaterializedDepartures bool
	// UseMaterialized reads active entities from the materialized active tables.
	UseMaterialized bool
}

type RTJsonFile

type RTJsonFile struct {
	Feed  string
	Ftype string
	Fname string
	// How long before the test's time the fixture was fetched; zero for a
	// fixture fetched then.
	Age time.Duration
}

func BAVehiclePositionsRTJson added in v1.4.1

func BAVehiclePositionsRTJson() []RTJsonFile

BAVehiclePositionsRTJson is the BART vehicle positions fixture; see testdata/server/rt/BA-vehicle-positions.json for the vehicles it contains.

func DefaultRTJson

func DefaultRTJson() []RTJsonFile

Jump to

Keyboard shortcuts

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