testruntime

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFiles added in v0.35.0

func DeleteFiles(t testing.TB, rt *runtime.Runtime, id string, files ...string)

func DumpResources added in v0.35.0

func DumpResources(t testing.TB, rt *runtime.Runtime, id string)

func Must added in v0.35.0

func Must[T any](v T, err error) T

func New

func New(t TestingT) *runtime.Runtime

New returns a runtime configured for use in tests.

func NewInstance

func NewInstance(t TestingT) (*runtime.Runtime, string)

NewInstance is a convenience wrapper around NewInstanceWithOptions, using defaults sensible for most tests.

func NewInstanceForProject

func NewInstanceForProject(t TestingT, name string) (*runtime.Runtime, string)

NewInstanceForProject creates a runtime and an instance for use in tests. The passed name should match a test project in the testdata folder. You should not do mutable repo operations on the returned instance.

func NewInstanceWithModel

func NewInstanceWithModel(t TestingT, name, sql string) (*runtime.Runtime, string)

NewInstanceWithModel creates a runtime and an instance for use in tests. The passed model name and SQL SELECT statement will be loaded into the instance.

func NewInstanceWithOptions added in v0.35.0

func NewInstanceWithOptions(t TestingT, opts InstanceOptions) (*runtime.Runtime, string)

NewInstanceWithOptions creates a runtime and an instance for use in tests. The instance's repo is a temp directory that will be cleared when the tests finish.

func PutFiles added in v0.35.0

func PutFiles(t testing.TB, rt *runtime.Runtime, id string, files map[string]string)

func ReconcileAndWait added in v0.35.0

func ReconcileAndWait(t testing.TB, rt *runtime.Runtime, id string, n *runtimev1.ResourceName)

func ReconcileParserAndWait added in v0.35.0

func ReconcileParserAndWait(t testing.TB, rt *runtime.Runtime, id string)

func RefreshAndWait added in v0.35.0

func RefreshAndWait(t testing.TB, rt *runtime.Runtime, id string, n *runtimev1.ResourceName)

func RenameFile added in v0.36.0

func RenameFile(t testing.TB, rt *runtime.Runtime, id, from, to string)

func RequireIsView added in v0.36.0

func RequireIsView(t testing.TB, olap drivers.OLAPStore, tableName string, isView bool)

func RequireNoOLAPTable added in v0.35.0

func RequireNoOLAPTable(t testing.TB, rt *runtime.Runtime, id, name string)

func RequireOLAPTable added in v0.35.0

func RequireOLAPTable(t testing.TB, rt *runtime.Runtime, id, name string)

func RequireOLAPTableCount added in v0.35.0

func RequireOLAPTableCount(t testing.TB, rt *runtime.Runtime, id, name string, count int)

func RequireParseErrors added in v0.36.0

func RequireParseErrors(t testing.TB, rt *runtime.Runtime, id string, expectedParseErrors map[string]string)

func RequireReconcileState added in v0.35.0

func RequireReconcileState(t testing.TB, rt *runtime.Runtime, id string, lenResources, lenReconcileErrs, lenParseErrs int)

func RequireResource added in v0.35.0

func RequireResource(t testing.TB, rt *runtime.Runtime, id string, a *runtimev1.Resource)

Types

type InstanceOptions added in v0.35.0

type InstanceOptions struct {
	Files                        map[string]string
	Variables                    map[string]string
	WatchRepo                    bool
	StageChanges                 bool
	ModelDefaultMaterialize      bool
	ModelMaterializeDelaySeconds uint32
}

InstanceOptions enables configuration of the instance options that are configurable in tests.

type TestingT

type TestingT interface {
	Name() string
	TempDir() string
	FailNow()
	Errorf(format string, args ...interface{})
	Cleanup(f func())
}

TestingT satisfies both *testing.T and *testing.B.

Jump to

Keyboard shortcuts

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