testplugin

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileCEL added in v0.4.1

func CompileCEL(expression string) (cel.Program, error)

CompileCEL はCEL式をコンパイルしてプログラムを返す。 出力型はboolに制限される。

func EvaluateCEL

func EvaluateCEL(expression string, object map[string]any) (bool, error)

EvaluateCEL はCEL式をコンパイルして評価し、結果をboolで返す。 ポーリングループから呼ぶ場合はコンパイル結果を再利用できる CompileCEL + evaluateCELProgram の経路を使うこと。

func Start

func Start(
	ctx context.Context,
	logger *slog.Logger,
	spec *v1.TestPluginSpec,
	f func(ctx context.Context, logger *slog.Logger, spec *v1.TestPluginSpec) error,
) error

Startは各テストプラグインに依存しない共通的な挙動を実装する高階関数です specの設定に基づき、引数に渡されたテスト関数を実行ループします

TimeoutSeconds が 0 の場合はタイムアウトせず、成功条件を満たすか ctx がキャンセルされるまで待ち続けます。

Types

type ExistNonExist

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

func NewExistNonExist

func NewExistNonExist(c client.Client) *ExistNonExist

func (*ExistNonExist) Run

func (e *ExistNonExist) Run(
	ctx context.Context,
	logger *slog.Logger,
	spec *v1.TestPluginSpec,
) error

Run implements Plugin.

func (*ExistNonExist) Type

func (e *ExistNonExist) Type() v1.TestPluginType

Type implements Plugin.

type Plugin

type Plugin interface {
	Type() v1.TestPluginType
	Run(ctx context.Context, logger *slog.Logger, spec *v1.TestPluginSpec) error
}

type WaitUntil

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

func NewWaitUntil

func NewWaitUntil(c client.Client) *WaitUntil

func (*WaitUntil) Run

func (w *WaitUntil) Run(
	ctx context.Context,
	logger *slog.Logger,
	spec *v1.TestPluginSpec,
) error

Run implements Plugin.

func (*WaitUntil) Type

func (w *WaitUntil) Type() v1.TestPluginType

Type implements Plugin.

Jump to

Keyboard shortcuts

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