testutils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const K3sManifests = "/var/lib/rancher/k3s/server/manifests/"

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

func ExtractManifests

func ExtractManifests(to, from string, isolateKinds []string) error

ExtractManifests is meant to read in a concatenated manifest file and extract the individual manifest described by the isolateKind and write it to the to path.

to: directory isolateKinds: kinds of manifests to extract from: path to concatenated manifest file, should be from the root, not relative. example - build/k8s/ingestor.yaml

to will contain two files: - manifests.yaml: all manifests except for the isolateKind - {isolateKind}.yaml: the manifest described by the isolateKind

func FunctionExists

func FunctionExists(ctx context.Context, t *testing.T, database, function, uri string) bool

func GetGitRootDir

func GetGitRootDir() (string, error)

func GetKubeConfig

func GetKubeConfig(ctx context.Context, k *k3s.K3sContainer) (*rest.Config, ctrlclient.Client, error)

func InstallCrds added in v0.2.0

func InstallCrds(ctx context.Context, k *k3s.K3sContainer) error

func IntegrationTest

func IntegrationTest(t *testing.T)

func RelativePath added in v0.2.0

func RelativePath(artifact string) (string, bool)

RelativePath attempts to find artifact by walking up the directory tree backwards

func TableExists

func TableExists(ctx context.Context, t *testing.T, database, table, uri string) bool

func TableHasRows

func TableHasRows(ctx context.Context, t *testing.T, database, table, uri string) bool

func VerifyTableSchema

func VerifyTableSchema(ctx context.Context, t *testing.T, database, table, uri string, expect TableSchema)

func WriteKubeConfig

func WriteKubeConfig(ctx context.Context, k *k3s.K3sContainer, dir string) (string, error)

Types

type Function

type Function struct {
	Name       string `kusto:"Name"`
	Parameters string `kusto:"Parameters"`
	Body       string `kusto:"Body"`
	Folder     string `kusto:"Folder"`
	DocString  string `kusto:"DocString"`
}

func GetFunction

func GetFunction(ctx context.Context, t *testing.T, database, function, uri string) Function

type KqlSchema

type KqlSchema struct {
	ColumnName    string `kusto:"ColumnName"`
	ColumnOrdinal int    `kusto:"ColumnOrdinal"`
	DataType      string `kusto:"DataType"`
	ColumnType    string `kusto:"ColumnType"`
}

type RowCount

type RowCount struct {
	Count int64 `kusto:"Count"`
}

type Table

type Table struct {
	TableName    string `kusto:"TableName"`
	DatabaseName string `kusto:"DatabaseName"`
	Folder       string `kusto:"Folder"`
	DocString    string `kusto:"DocString"`
}

type TableSchema

type TableSchema interface {
	TableName() string
	CslColumns() []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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