recipe

package
v0.0.0-rc12 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

YT Saurus Recipe

This recipe is either start docker container with yt-local or use predifined YT_PROXY. For better debug there is docker-compose.yml which provide local YT with UI, so you can check out how it looks with your own eyes.

Like https://github.com/ytsaurus/ytsaurus/blob/main/yt/docker/local/run_local_cluster.sh, but automated.

To run this in tests simply:

Target = yt_recipe.RecipeYtTarget("//home/cdc/test/pg2yt_e2e")

And this will spawn a container and create a target connection to this container.

Documentation

Index

Constants

View Source
const (
	DefaultUser     = "admin"
	DefaultPassword = "password"
	DefaultToken    = "password"
)

Variables

This section is empty.

Functions

func CanonizeDynamicYtTable

func CanonizeDynamicYtTable(t *testing.T, ytClient yt.Client, tablePath ypath.Path, fileName string)

func ChSchemaForYtTypesTestData

func ChSchemaForYtTypesTestData() string

func DumpDynamicYtTable

func DumpDynamicYtTable(ytClient yt.Client, tablePath ypath.Path, writer io.Writer) error

func Main

func Main(m *testing.M)

func NewEnv

func NewEnv(t *testing.T, opts ...yttest.Option) (*yttest.Env, func())

func NewEnvWithNode

func NewEnvWithNode(t *testing.T, path string) *yttest.Env

func RecipeYtTarget

func RecipeYtTarget(path string) (yt_provider.YtDestinationModel, func() error, error)

func TestContainerEnabled

func TestContainerEnabled() bool

func WithAuth

func WithAuth() testcontainers.CustomizeRequestOption

WithAuth enables authentication on http proxies and creates `admin` user with password and token `password`.

func YtReadAllRowsFromAllTables

func YtReadAllRowsFromAllTables[OutRow any](t *testing.T, cluster string, path string, expectedResCount int) []OutRow

func YtTestDir

func YtTestDir(t *testing.T, testSuiteName string) ypath.Path

func YtTypesTestData

func YtTypesTestData() ([]schema.Column, []map[string]any)

Types

type YTsaurusContainer

type YTsaurusContainer struct {
	testcontainers.Container
}

YTsaurusContainer represents the YTsaurus container type used in the module.

func RunContainer

func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*YTsaurusContainer, error)

RunContainer creates and starts an instance of the YTsaurus container.

func (*YTsaurusContainer) ConnectionHost

func (y *YTsaurusContainer) ConnectionHost(ctx context.Context) (string, error)

ConnectionHost returns the host and dynamic port for accessing the YTsaurus container.

func (*YTsaurusContainer) GetProxy

func (y *YTsaurusContainer) GetProxy(ctx context.Context) (string, error)

GetProxy is an alias for ConnectionHost since `proxy` is more familiar term for in YTsaurus.

func (*YTsaurusContainer) NewClient

func (y *YTsaurusContainer) NewClient(ctx context.Context) (yt.Client, error)

NewClient creates a new YT client connected to the YTsaurus container.

func (*YTsaurusContainer) Token

func (y *YTsaurusContainer) Token() string

Token returns the token for the YTsaurus container.

Jump to

Keyboard shortcuts

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