integrationtestsupport

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockNowProvider

func MockNowProvider()

func RequestBodyToTelemetryEventsProto

func RequestBodyToTelemetryEventsProto(suite *suite.Suite, request *http.Request) *prefabProto.TelemetryEvents

func StartTestServer

func StartTestServer() (*[]*http.Request, *httptest.Server)

Types

type ClientOverridesYaml

type ClientOverridesYaml struct {
	InitializationTimeOutSec *float64 `yaml:"initialization_timeout_sec"`
	PrefabAPIURL             *string  `yaml:"prefab_api_url"`
	OnInitFailure            *string  `yaml:"on_init_failure"`
}

type ContextShapeTestHarness

type ContextShapeTestHarness struct {
	// contains filtered or unexported fields
}

func (ContextShapeTestHarness) Exercise

func (ContextShapeTestHarness) GetExpectedEvents

func (c ContextShapeTestHarness) GetExpectedEvents() ([]*prefabProto.TelemetryEvent, error)

func (ContextShapeTestHarness) GetOptions

func (c ContextShapeTestHarness) GetOptions() []prefab.Option

func (ContextShapeTestHarness) MassagePayload

type EvaluationSummaryTestHarness

type EvaluationSummaryTestHarness struct {
	// contains filtered or unexported fields
}

func (EvaluationSummaryTestHarness) Exercise

func (EvaluationSummaryTestHarness) ExpectedData

func (EvaluationSummaryTestHarness) GetExpectedEvents

func (c EvaluationSummaryTestHarness) GetExpectedEvents() ([]*prefabProto.TelemetryEvent, error)

func (EvaluationSummaryTestHarness) GetOptions

func (c EvaluationSummaryTestHarness) GetOptions() []prefab.Option

func (EvaluationSummaryTestHarness) MassagePayload

type ExampleContextTestHarness

type ExampleContextTestHarness struct {
	// contains filtered or unexported fields
}

func (ExampleContextTestHarness) Exercise

func (ExampleContextTestHarness) GetExpectedEvents

func (c ExampleContextTestHarness) GetExpectedEvents() ([]*prefabProto.TelemetryEvent, error)

func (ExampleContextTestHarness) GetOptions

func (c ExampleContextTestHarness) GetOptions() []prefab.Option

func (ExampleContextTestHarness) MassagePayload

type ExpectedEvaluationSummaryData

type ExpectedEvaluationSummaryData struct {
	Key        string `yaml:"key"`
	Value      any    `yaml:"value"`
	ConfigType string `yaml:"type"`
	ValueType  string `yaml:"value_type"`
	Count      int    `yaml:"count"`
	Summary    struct {
		ConfigRowIndex        *uint32 `yaml:"config_row_index"`
		ConditionalValueIndex *uint32 `yaml:"conditional_value_index"`
		WeightedValueIndex    *uint32 `yaml:"weighted_value_index"`
	} `yaml:"summary"`
}

type GetTest

type GetTest struct {
	Name  string            `yaml:"name"`
	Cases []GetTestCaseYaml `yaml:"cases"`
}

type GetTestCase

type GetTestCase struct {
	Contexts TestCaseContexts
	GetTestCaseYaml
	TestName string
}

func (GetTestCase) GetBlockContexts

func (t GetTestCase) GetBlockContexts() *contexts.ContextSet

func (GetTestCase) GetClientOverrides

func (t GetTestCase) GetClientOverrides() *ClientOverridesYaml

func (GetTestCase) GetGlobalContexts

func (t GetTestCase) GetGlobalContexts() *contexts.ContextSet

type GetTestCaseYaml

type GetTestCaseYaml struct {
	Expected        expected               `yaml:"expected"`
	Input           input                  `yaml:"input"`
	Type            *string                `yaml:"type"`
	ClientOverrides *ClientOverridesYaml   `yaml:"client_overrides"`
	RawContexts     map[string]TestContext `yaml:"contexts"`
	CaseName        string                 `yaml:"name"`
	Client          string                 `yaml:"client"`
	Function        string                 `yaml:"function"`
}

type TelemetryTest

type TelemetryTest struct {
	Cases []TelemetryTestCaseYaml `yaml:"cases"`
}

type TelemetryTestCase

type TelemetryTestCase struct {
	Contexts   TestCaseContexts
	Aggregator string
	TestName   string
	Err        error
	Yaml       TelemetryTestCaseYaml
	RawYaml    []byte
}

func (TelemetryTestCase) GetBlockContexts

func (t TelemetryTestCase) GetBlockContexts() *contexts.ContextSet

func (TelemetryTestCase) GetClientOverrides

func (t TelemetryTestCase) GetClientOverrides() *ClientOverridesYaml

func (TelemetryTestCase) GetGlobalContexts

func (t TelemetryTestCase) GetGlobalContexts() *contexts.ContextSet

type TelemetryTestCaseYaml

type TelemetryTestCaseYaml struct {
	Aggregator   string      `yaml:"aggregator"`
	Endpoint     string      `yaml:"endpoint"`
	Data         interface{} `yaml:"data"`
	ExpectedData interface{} `yaml:"expected_data"`
	CaseName     string      `yaml:"name"`
	Client       string      `yaml:"client"`
	Function     string      `yaml:"function"`
}

type TelemetryTestHarness

type TelemetryTestHarness interface {
	GetOptions() []prefab.Option
	GetExpectedEvents() ([]*prefabProto.TelemetryEvent, error)
	Exercise(*prefab.ContextBoundClient) error
	MassagePayload(events *prefabProto.TelemetryEvents) *prefabProto.TelemetryEvents
}

func NewTelemetryTestHarness

func NewTelemetryTestHarness(testCase TelemetryTestCase) TelemetryTestHarness

type TestCaseContexts

type TestCaseContexts struct {
	Global *contexts.ContextSet
	Local  *contexts.ContextSet
	Block  *contexts.ContextSet
}

type TestContext

type TestContext = map[string]map[string]interface{}

Jump to

Keyboard shortcuts

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