client

package
v1.11.8-beta-06 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const TestkubeInstallationNamespace = "testkube"

TestkubeInstallationNamespace where Testkube is installed

View Source
const Version = "v1"

Version is client version literal

Variables

This section is empty.

Functions

func ConfigureClient added in v1.8.6

func ConfigureClient(client *http.Client, token *oauth2.Token, cloudApiKey string)

func GetClientSet

func GetClientSet(overrideHost string) (clientset kubernetes.Interface, err error)

GetClientSet configures Kube client set, can override host with local proxy

func StreamToLogsChannel added in v0.6.5

func StreamToLogsChannel(resp io.Reader, logs chan output.Output)

StreamToLogsChannel converts io.Reader with SSE data like `data: {"type": "event", "message":"something"}` to channel of output.Output objects, helps with logs streaming from SSE endpoint (passed from job executor)

Types

type APIClient added in v0.10.0

APIClient struct managing proxy API Client dependencies

func NewDirectAPIClient added in v0.9.5

func NewDirectAPIClient(httpClient *http.Client, sseClient *http.Client, apiURI, apiPathPrefix string) APIClient

NewDirectAPIClient returns direct api client

func NewProxyAPIClient added in v0.9.5

func NewProxyAPIClient(client kubernetes.Interface, config APIConfig) APIClient

NewProxyAPIClient returns proxy api client

type APIConfig added in v0.10.2

type APIConfig struct {
	// Namespace where testkube is installed
	Namespace string
	// API Server service name
	ServiceName string
	// API Server service port
	ServicePort int
}

func NewAPIConfig added in v0.10.2

func NewAPIConfig(namespace, serviceName string, servicePort int) APIConfig

type All added in v1.1.16

type All interface {
	Gettable | Executable
}

All is an interface of all objects

type Client

Client is the Testkube API client abstraction

func GetClient

func GetClient(clientType ClientType, options Options) (client Client, err error)

GetClient returns configured Testkube API client, can be one of direct and proxy - direct need additional proxy to be run (`make api-proxy`)

type ClientType

type ClientType string
const (
	ClientDirect ClientType = "direct"
	ClientCloud  ClientType = "cloud"
	ClientProxy  ClientType = "proxy"
)

type ConfigAPI added in v1.2.34

type ConfigAPI interface {
	UpdateConfig(config testkube.Config) (outputConfig testkube.Config, err error)
	GetConfig() (config testkube.Config, err error)
}

ConfigAPI describes config api methods

type ConfigClient added in v1.5.15

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

ConfigClient is a client for config

func NewConfigClient added in v1.5.15

func NewConfigClient(configTransport Transport[testkube.Config]) ConfigClient

NewConfigClient creates new Cnfig client

func (ConfigClient) GetConfig added in v1.5.15

func (c ConfigClient) GetConfig() (config testkube.Config, err error)

func (ConfigClient) UpdateConfig added in v1.5.15

func (c ConfigClient) UpdateConfig(config testkube.Config) (outputConfig testkube.Config, err error)

type CopyFileAPI added in v1.6.35

type CopyFileAPI interface {
	UploadFile(parentName string, parentType TestingType, filePath string, fileContent []byte, timeout time.Duration) error
}

CopyFileAPI describes methods to handle files in the object storage

type CopyFileClient added in v1.6.35

type CopyFileClient interface {
	UploadFile(parentName string, parentType TestingType, filePath string, fileContent []byte, timeout time.Duration) error
}

type CopyFileDirectClient added in v1.6.35

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

func NewCopyFileDirectClient added in v1.6.35

func NewCopyFileDirectClient(httpClient *http.Client, apiURI, apiPathPrefix string) *CopyFileDirectClient

func (CopyFileDirectClient) UploadFile added in v1.6.35

func (c CopyFileDirectClient) UploadFile(parentName string, parentType TestingType, filePath string, fileContent []byte, timeout time.Duration) error

UploadFile uploads a copy file to the API server

type CopyFileProxyClient added in v1.6.35

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

func NewCopyFileProxyClient added in v1.6.35

func NewCopyFileProxyClient(client kubernetes.Interface, config APIConfig) *CopyFileProxyClient

func (CopyFileProxyClient) UploadFile added in v1.6.35

func (c CopyFileProxyClient) UploadFile(parentName string, parentType TestingType, filePath string, fileContent []byte, timeout time.Duration) error

UploadFile uploads a copy file to the API server

type CreateWebhookOptions added in v0.9.18

type CreateWebhookOptions testkube.WebhookCreateRequest

CreateWebhookOptions - is mapping for now to OpenAPI schema for creating/changing webhook

type DirectClient added in v1.1.16

type DirectClient[A All] struct {
	// contains filtered or unexported fields
}

DirectClient implements direct client

func NewDirectClient added in v1.1.16

func NewDirectClient[A All](httpClient *http.Client, apiURI, apiPathPrefix string) DirectClient[A]

NewDirectClient returns new direct client

func (DirectClient[A]) Delete added in v1.1.16

func (t DirectClient[A]) Delete(uri, selector string, isContentExpected bool) error

Delete is a method to make delete api call

func (DirectClient[A]) Execute added in v1.1.16

func (t DirectClient[A]) Execute(method, uri string, body []byte, params map[string]string) (result A, err error)

Execute is a method to make an api call for a single object

func (DirectClient[A]) ExecuteMethod added in v1.6.33

func (t DirectClient[A]) ExecuteMethod(method, uri string, selector string, isContentExpected bool) error

func (DirectClient[A]) ExecuteMultiple added in v1.1.16

func (t DirectClient[A]) ExecuteMultiple(method, uri string, body []byte, params map[string]string) (result []A, err error)

ExecuteMultiple is a method to make an api call for multiple objects

func (DirectClient[A]) GetFile added in v1.1.16

func (t DirectClient[A]) GetFile(uri, fileName, destination string, params map[string][]string) (name string, err error)

GetFile returns file artifact

func (DirectClient[A]) GetLogs added in v1.1.16

func (t DirectClient[A]) GetLogs(uri string, logs chan output.Output) error

GetLogs returns logs stream from job pods, based on job pods logs

func (DirectClient[A]) GetURI added in v1.1.16

func (t DirectClient[A]) GetURI(pathTemplate string, params ...interface{}) string

GetURI returns uri for api method

func (DirectClient[A]) WithSSEClient added in v1.5.31

func (t DirectClient[A]) WithSSEClient(client *http.Client) DirectClient[A]

type Executable added in v1.1.16

Executable is an interface of executable objects

type ExecuteTestOptions added in v1.0.23

type ExecuteTestOptions struct {
	ExecutionVariables            map[string]testkube.Variable
	ExecutionVariablesFileContent string
	ExecutionLabels               map[string]string
	Args                          []string
	Envs                          map[string]string
	SecretEnvs                    map[string]string
	HTTPProxy                     string
	HTTPSProxy                    string
	Image                         string
	Uploads                       []string
	BucketName                    string
	ArtifactRequest               *testkube.ArtifactRequest
	JobTemplate                   string
	ContentRequest                *testkube.TestContentRequest
	PreRunScriptContent           string
	ScraperTemplate               string
	NegativeTest                  bool
	IsNegativeTestChangedOnRun    bool
	EnvConfigMaps                 []testkube.EnvReference
	EnvSecrets                    []testkube.EnvReference
	RunningContext                *testkube.RunningContext
}

TODO consider replacing it with testkube.ExecutionRequest - looks almost the samea and redundant ExecuteTestOptions contains test run options

type ExecuteTestSuiteOptions added in v1.1.2

type ExecuteTestSuiteOptions struct {
	ExecutionVariables map[string]testkube.Variable
	HTTPProxy          string
	HTTPSProxy         string
	ExecutionLabels    map[string]string
	ContentRequest     *testkube.TestContentRequest
	RunningContext     *testkube.RunningContext
}

ExecuteTestSuiteOptions contains test suite run options

type ExecutionAPI added in v1.1.16

type ExecutionAPI interface {
	GetExecution(executionID string) (execution testkube.Execution, err error)
	ListExecutions(id string, limit int, selector string) (executions testkube.ExecutionsResult, err error)
	AbortExecution(test string, id string) error
	AbortExecutions(test string) error
	GetExecutionArtifacts(executionID string) (artifacts testkube.Artifacts, err error)
	DownloadFile(executionID, fileName, destination string) (artifact string, err error)
	DownloadArchive(executionID, destination string, masks []string) (archive string, err error)
}

ExecutionAPI describes execution api methods

type ExecutorAPI added in v1.1.16

type ExecutorAPI interface {
	CreateExecutor(options UpsertExecutorOptions) (executor testkube.ExecutorDetails, err error)
	UpdateExecutor(options UpdateExecutorOptions) (executor testkube.ExecutorDetails, err error)
	GetExecutor(name string) (executor testkube.ExecutorDetails, err error)
	ListExecutors(selector string) (executors testkube.ExecutorsDetails, err error)
	DeleteExecutor(name string) (err error)
	DeleteExecutors(selector string) (err error)
}

ExecutorAPI describes executor api methods

type ExecutorClient added in v1.1.16

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

ExecutorClient is a client for executors

func NewExecutorClient added in v1.1.16

func NewExecutorClient(executorTransport Transport[testkube.ExecutorDetails]) ExecutorClient

NewExecutorClient creates new Executor client

func (ExecutorClient) CreateExecutor added in v1.1.16

func (c ExecutorClient) CreateExecutor(options UpsertExecutorOptions) (executor testkube.ExecutorDetails, err error)

CreateExecutor creates new Executor Custom Resource

func (ExecutorClient) DeleteExecutor added in v1.1.16

func (c ExecutorClient) DeleteExecutor(name string) (err error)

DeleteExecutor deletes single executor by name

func (ExecutorClient) DeleteExecutors added in v1.1.16

func (c ExecutorClient) DeleteExecutors(selector string) (err error)

DeleteExecutors deletes all executors

func (ExecutorClient) GetExecutor added in v1.1.16

func (c ExecutorClient) GetExecutor(name string) (executor testkube.ExecutorDetails, err error)

GetExecutor gets executor by name

func (ExecutorClient) ListExecutors added in v1.1.16

func (c ExecutorClient) ListExecutors(selector string) (executors testkube.ExecutorsDetails, err error)

ListExecutors list all executors

func (ExecutorClient) UpdateExecutor added in v1.6.12

func (c ExecutorClient) UpdateExecutor(options UpdateExecutorOptions) (executor testkube.ExecutorDetails, err error)

UpdateExecutor updates Executor Custom Resource

type Options added in v1.1.16

type Options struct {
	Namespace     string
	ApiUri        string
	ApiPath       string
	Token         *oauth2.Token
	Provider      oauth.ProviderType
	ClientID      string
	ClientSecret  string
	Scopes        []string
	APIServerName string
	APIServerPort int

	// Testkube Cloud
	CloudApiPathPrefix string
	CloudApiKey        string
	CloudOrganization  string
	CloudEnvironment   string
}

Options contains client options

type ProxyClient added in v1.1.16

type ProxyClient[A All] struct {
	// contains filtered or unexported fields
}

ProxyClient implements proxy client

func NewProxyClient added in v1.1.16

func NewProxyClient[A All](client kubernetes.Interface, config APIConfig) ProxyClient[A]

NewProxyClient returns new proxy client

func (ProxyClient[A]) Delete added in v1.1.16

func (t ProxyClient[A]) Delete(uri, selector string, isContentExpected bool) error

Delete is a method to make delete api call

func (ProxyClient[A]) Execute added in v1.1.16

func (t ProxyClient[A]) Execute(method, uri string, body []byte, params map[string]string) (result A, err error)

Execute is a method to make an api call for a single object

func (ProxyClient[A]) ExecuteMethod added in v1.6.33

func (t ProxyClient[A]) ExecuteMethod(method, uri string, selector string, isContentExpected bool) error

func (ProxyClient[A]) ExecuteMultiple added in v1.1.16

func (t ProxyClient[A]) ExecuteMultiple(method, uri string, body []byte, params map[string]string) (result []A, err error)

ExecuteMultiple is a method to make an api call for multiple objects

func (ProxyClient[A]) GetFile added in v1.1.16

func (t ProxyClient[A]) GetFile(uri, fileName, destination string, params map[string][]string) (name string, err error)

GetFile returns file artifact

func (ProxyClient[A]) GetLogs added in v1.1.16

func (t ProxyClient[A]) GetLogs(uri string, logs chan output.Output) error

GetLogs returns logs stream from job pods, based on job pods logs

func (ProxyClient[A]) GetURI added in v1.1.16

func (t ProxyClient[A]) GetURI(pathTemplate string, params ...interface{}) string

GetURI returns uri for api method

type ServiceAPI added in v1.1.16

type ServiceAPI interface {
	GetServerInfo() (info testkube.ServerInfo, err error)
	GetDebugInfo() (info testkube.DebugInfo, err error)
}

ServiceAPI describes service api methods

type TestAPI added in v1.1.16

type TestAPI interface {
	GetTest(id string) (test testkube.Test, err error)
	GetTestWithExecution(id string) (test testkube.TestWithExecution, err error)
	CreateTest(options UpsertTestOptions) (test testkube.Test, err error)
	UpdateTest(options UpdateTestOptions) (test testkube.Test, err error)
	DeleteTest(name string) error
	DeleteTests(selector string) error
	ListTests(selector string) (tests testkube.Tests, err error)
	ListTestWithExecutionSummaries(selector string) (tests testkube.TestWithExecutionSummaries, err error)
	ExecuteTest(id, executionName string, options ExecuteTestOptions) (executions testkube.Execution, err error)
	ExecuteTests(selector string, concurrencyLevel int, options ExecuteTestOptions) (executions []testkube.Execution, err error)
	Logs(id string) (logs chan output.Output, err error)
}

TestAPI describes test api methods

type TestClient added in v1.1.16

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

TestClient is a client for tests

func NewTestClient added in v1.1.16

func NewTestClient(
	testTransport Transport[testkube.Test],
	executionTransport Transport[testkube.Execution],
	testWithExecutionTransport Transport[testkube.TestWithExecution],
	testWithExecutionSummaryTransport Transport[testkube.TestWithExecutionSummary],
	executionsResultTransport Transport[testkube.ExecutionsResult],
	artifactTransport Transport[testkube.Artifact],
	serverInfoTransport Transport[testkube.ServerInfo],
	debugInfoTransport Transport[testkube.DebugInfo],
) TestClient

NewTestClient creates new Test client

func (TestClient) AbortExecution added in v1.1.16

func (c TestClient) AbortExecution(testID, id string) error

AbortExecution aborts execution by testId and id

func (TestClient) AbortExecutions added in v1.9.22

func (c TestClient) AbortExecutions(testID string) error

AbortExecutions aborts all the executions of a test

func (TestClient) CreateTest added in v1.1.16

func (c TestClient) CreateTest(options UpsertTestOptions) (test testkube.Test, err error)

CreateTest creates new Test Custom Resource

func (TestClient) DeleteTest added in v1.1.16

func (c TestClient) DeleteTest(name string) error

DeleteTest deletes single test by name

func (TestClient) DeleteTests added in v1.1.16

func (c TestClient) DeleteTests(selector string) error

DeleteTests deletes all tests

func (TestClient) DownloadArchive added in v1.10.45

func (c TestClient) DownloadArchive(executionID, destination string, masks []string) (archive string, err error)

DownloadArchive downloads archive

func (TestClient) DownloadFile added in v1.1.16

func (c TestClient) DownloadFile(executionID, fileName, destination string) (artifact string, err error)

DownloadFile downloads file

func (TestClient) ExecuteTest added in v1.1.16

func (c TestClient) ExecuteTest(id, executionName string, options ExecuteTestOptions) (execution testkube.Execution, err error)

ExecuteTest starts test execution, reads data and returns ID execution is started asynchronously client can check later for results

func (TestClient) ExecuteTests added in v1.1.16

func (c TestClient) ExecuteTests(selector string, concurrencyLevel int, options ExecuteTestOptions) (executions []testkube.Execution, err error)

ExecuteTests starts test executions, reads data and returns IDs executions are started asynchronously client can check later for results

func (TestClient) GetDebugInfo added in v1.3.45

func (c TestClient) GetDebugInfo() (debugInfo testkube.DebugInfo, err error)

func (TestClient) GetExecution added in v1.1.16

func (c TestClient) GetExecution(executionID string) (execution testkube.Execution, err error)

GetExecution returns test execution by excution id

func (TestClient) GetExecutionArtifacts added in v1.1.16

func (c TestClient) GetExecutionArtifacts(executionID string) (artifacts testkube.Artifacts, err error)

GetExecutionArtifacts returns execution artifacts

func (TestClient) GetServerInfo added in v1.1.16

func (c TestClient) GetServerInfo() (info testkube.ServerInfo, err error)

GetServerInfo returns server info

func (TestClient) GetTest added in v1.1.16

func (c TestClient) GetTest(id string) (test testkube.Test, err error)

GetTest returns single test by id

func (TestClient) GetTestWithExecution added in v1.1.16

func (c TestClient) GetTestWithExecution(id string) (test testkube.TestWithExecution, err error)

GetTestWithExecution returns single test by id with execution

func (TestClient) ListExecutions added in v1.1.16

func (c TestClient) ListExecutions(id string, limit int, selector string) (executions testkube.ExecutionsResult, err error)

ListExecutions list all executions for given test name

func (TestClient) ListTestWithExecutionSummaries added in v1.7.7

func (c TestClient) ListTestWithExecutionSummaries(selector string) (testWithExecutionSummaries testkube.TestWithExecutionSummaries, err error)

ListTestWithExecutionSummaries list all test with execution summaries

func (TestClient) ListTests added in v1.1.16

func (c TestClient) ListTests(selector string) (tests testkube.Tests, err error)

ListTests list all tests

func (TestClient) Logs added in v1.1.16

func (c TestClient) Logs(id string) (logs chan output.Output, err error)

Logs returns logs stream from job pods, based on job pods logs

func (TestClient) UpdateTest added in v1.1.16

func (c TestClient) UpdateTest(options UpdateTestOptions) (test testkube.Test, err error)

UpdateTest updates Test Custom Resource

type TestSourceAPI added in v1.5.29

type TestSourceAPI interface {
	CreateTestSource(options UpsertTestSourceOptions) (testSource testkube.TestSource, err error)
	UpdateTestSource(options UpdateTestSourceOptions) (testSource testkube.TestSource, err error)
	GetTestSource(name string) (testSource testkube.TestSource, err error)
	ListTestSources(selector string) (testSources testkube.TestSources, err error)
	DeleteTestSource(name string) (err error)
	DeleteTestSources(selector string) (err error)
}

TestSourceAPI describes test source api methods

type TestSourceClient added in v1.5.29

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

TestSourceClient is a client for test sources

func NewTestSourceClient added in v1.5.29

func NewTestSourceClient(testSourceTransport Transport[testkube.TestSource]) TestSourceClient

NewTestSourceClient creates new TestSource client

func (TestSourceClient) CreateTestSource added in v1.5.29

func (c TestSourceClient) CreateTestSource(options UpsertTestSourceOptions) (testSource testkube.TestSource, err error)

CreateTestSource creates new TestSource Custom Resource

func (TestSourceClient) DeleteTestSource added in v1.5.29

func (c TestSourceClient) DeleteTestSource(name string) (err error)

DeleteTestSource deletes single test source by name

func (TestSourceClient) DeleteTestSources added in v1.5.29

func (c TestSourceClient) DeleteTestSources(selector string) (err error)

DeleteTestSources deletes all test sources

func (TestSourceClient) GetTestSource added in v1.5.29

func (c TestSourceClient) GetTestSource(name string) (testSource testkube.TestSource, err error)

GetTestSource gets test source by name

func (TestSourceClient) ListTestSources added in v1.5.29

func (c TestSourceClient) ListTestSources(selector string) (testSources testkube.TestSources, err error)

ListTestSources list all test sources

func (TestSourceClient) UpdateTestSource added in v1.5.29

func (c TestSourceClient) UpdateTestSource(options UpdateTestSourceOptions) (testSource testkube.TestSource, err error)

UpdateTestSource updates TestSource Custom Resource

type TestSuiteAPI added in v1.1.16

type TestSuiteAPI interface {
	CreateTestSuite(options UpsertTestSuiteOptions) (testSuite testkube.TestSuite, err error)
	UpdateTestSuite(options UpdateTestSuiteOptions) (testSuite testkube.TestSuite, err error)
	GetTestSuite(id string) (testSuite testkube.TestSuite, err error)
	GetTestSuiteWithExecution(id string) (testSuite testkube.TestSuiteWithExecution, err error)
	ListTestSuites(selector string) (testSuites testkube.TestSuites, err error)
	ListTestSuiteWithExecutionSummaries(selector string) (testSuitesWithExecutionSummaries testkube.TestSuiteWithExecutionSummaries, err error)
	DeleteTestSuite(name string) error
	DeleteTestSuites(selector string) error
	ExecuteTestSuite(id, executionName string, options ExecuteTestSuiteOptions) (executions testkube.TestSuiteExecution, err error)
	ExecuteTestSuites(selector string, concurrencyLevel int, options ExecuteTestSuiteOptions) (executions []testkube.TestSuiteExecution, err error)
}

TestSuiteAPI describes test suite api methods

type TestSuiteClient added in v1.1.16

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

TestSuiteClient is a client for test suites

func NewTestSuiteClient added in v1.1.16

func NewTestSuiteClient(
	testSuiteTransport Transport[testkube.TestSuite],
	testSuiteExecutionTransport Transport[testkube.TestSuiteExecution],
	testSuiteWithExecutionTransport Transport[testkube.TestSuiteWithExecution],
	testSuiteWithExecutionSummaryTransport Transport[testkube.TestSuiteWithExecutionSummary],
	testSuiteExecutionsResultTransport Transport[testkube.TestSuiteExecutionsResult],
	testSuiteArtifactTransport Transport[testkube.Artifact],
) TestSuiteClient

NewTestSuiteClient creates new TestSuite client

func (TestSuiteClient) AbortTestSuiteExecution added in v1.6.29

func (c TestSuiteClient) AbortTestSuiteExecution(executionID string) error

AbortTestSuiteExecution aborts a test suite execution

func (TestSuiteClient) CreateTestSuite added in v1.1.16

func (c TestSuiteClient) CreateTestSuite(options UpsertTestSuiteOptions) (testSuite testkube.TestSuite, err error)

CreateTestSuite creates new TestSuite Custom Resource

func (TestSuiteClient) DeleteTestSuite added in v1.1.16

func (c TestSuiteClient) DeleteTestSuite(name string) error

DeleteTestSuite deletes single test suite by name

func (TestSuiteClient) DeleteTestSuites added in v1.1.16

func (c TestSuiteClient) DeleteTestSuites(selector string) error

DeleteTestSuites deletes all test suites

func (TestSuiteClient) ExecuteTestSuite added in v1.1.16

func (c TestSuiteClient) ExecuteTestSuite(id, executionName string, options ExecuteTestSuiteOptions) (execution testkube.TestSuiteExecution, err error)

ExecuteTestSuite starts new external test suite execution, reads data and returns ID Execution is started asynchronously client can check later for results

func (TestSuiteClient) ExecuteTestSuites added in v1.1.16

func (c TestSuiteClient) ExecuteTestSuites(selector string, concurrencyLevel int, options ExecuteTestSuiteOptions) (executions []testkube.TestSuiteExecution, err error)

ExecuteTestSuites starts new external test suite executions, reads data and returns IDs Executions are started asynchronously client can check later for results

func (TestSuiteClient) GetTestSuite added in v1.1.16

func (c TestSuiteClient) GetTestSuite(id string) (testSuite testkube.TestSuite, err error)

GetTestSuite returns single test suite by id

func (TestSuiteClient) GetTestSuiteExecution added in v1.1.16

func (c TestSuiteClient) GetTestSuiteExecution(executionID string) (execution testkube.TestSuiteExecution, err error)

GetTestSuiteExecution returns test suite execution by excution id

func (TestSuiteClient) GetTestSuiteExecutionArtifacts added in v1.9.9

func (c TestSuiteClient) GetTestSuiteExecutionArtifacts(executionID string) (artifacts testkube.Artifacts, err error)

GetTestSuiteExecutionArtifacts returns test suite execution artifacts by excution id

func (TestSuiteClient) GetTestSuiteWithExecution added in v1.1.16

func (c TestSuiteClient) GetTestSuiteWithExecution(id string) (test testkube.TestSuiteWithExecution, err error)

GetTestSuitWithExecution returns single test suite by id with execution

func (TestSuiteClient) ListTestSuiteExecutions added in v1.1.16

func (c TestSuiteClient) ListTestSuiteExecutions(testID string, limit int, selector string) (executions testkube.TestSuiteExecutionsResult, err error)

ListTestSuiteExecutions list all executions for given test suite

func (TestSuiteClient) ListTestSuiteWithExecutionSummaries added in v1.7.7

func (c TestSuiteClient) ListTestSuiteWithExecutionSummaries(selector string) (
	testSuiteWithExecutionSummaries testkube.TestSuiteWithExecutionSummaries, err error)

ListTestSuiteWithExecutionSummaries list all test suite with execution summaries

func (TestSuiteClient) ListTestSuites added in v1.1.16

func (c TestSuiteClient) ListTestSuites(selector string) (testSuites testkube.TestSuites, err error)

ListTestSuites list all test suites

func (TestSuiteClient) UpdateTestSuite added in v1.1.16

func (c TestSuiteClient) UpdateTestSuite(options UpdateTestSuiteOptions) (testSuite testkube.TestSuite, err error)

UpdateTestSuite updates TestSuite Custom Resource

func (TestSuiteClient) WatchTestSuiteExecution added in v1.1.16

func (c TestSuiteClient) WatchTestSuiteExecution(executionID string) (executionCh chan testkube.TestSuiteExecution, err error)

WatchTestSuiteExecution watches for changes in channels of test suite executions steps

type TestSuiteExecutionAPI added in v1.1.16

type TestSuiteExecutionAPI interface {
	GetTestSuiteExecution(executionID string) (execution testkube.TestSuiteExecution, err error)
	ListTestSuiteExecutions(testsuite string, limit int, selector string) (executions testkube.TestSuiteExecutionsResult, err error)
	WatchTestSuiteExecution(executionID string) (execution chan testkube.TestSuiteExecution, err error)
	AbortTestSuiteExecution(executionID string) error
	GetTestSuiteExecutionArtifacts(executionID string) (artifacts testkube.Artifacts, err error)
}

TestSuiteExecutionAPI describes test suite execution api methods

type TestingType added in v1.6.35

type TestingType string
const (
	Test      TestingType = "test"
	Execution TestingType = "execution"
)

type Transport added in v1.1.16

type Transport[A All] interface {
	Execute(method, uri string, body []byte, params map[string]string) (result A, err error)
	ExecuteMultiple(method, uri string, body []byte, params map[string]string) (result []A, err error)
	Delete(uri, selector string, isContentExpected bool) error
	ExecuteMethod(method, uri, selector string, isContentExpected bool) error
	GetURI(pathTemplate string, params ...interface{}) string
	GetLogs(uri string, logs chan output.Output) error
	GetFile(uri, fileName, destination string, params map[string][]string) (name string, err error)
}

Transport provides methods to execute api calls

type UpdateExecutorOptions added in v1.7.29

type UpdateExecutorOptions testkube.ExecutorUpdateRequest

UpdateExecutorOptions - is mapping for now to OpenAPI schema for changing executor request

type UpdateTestOptions added in v1.7.29

type UpdateTestOptions testkube.TestUpdateRequest

UpdateTestOptions - is mapping for now to OpenAPI schema for changing test if needed can be extended to custom struct

type UpdateTestSourceOptions added in v1.7.29

type UpdateTestSourceOptions testkube.TestSourceUpdateRequest

UpdateTestSourceOptions - is mapping for now to OpenAPI schema for changing test source if needed can be extended to custom struct

type UpdateTestSuiteOptions added in v1.7.29

type UpdateTestSuiteOptions testkube.TestSuiteUpdateRequest

UpdateTestSuiteOptions - mapping to OpenAPI schema for changing testsuite

type UpsertExecutorOptions added in v1.6.12

type UpsertExecutorOptions testkube.ExecutorUpsertRequest

UpsertExecutorOptions - is mapping for now to OpenAPI schema for creating executor request

type UpsertTestOptions added in v0.7.6

type UpsertTestOptions testkube.TestUpsertRequest

UpsertTestOptions - is mapping for now to OpenAPI schema for creating test if needed can be extended to custom struct

type UpsertTestSourceOptions added in v1.5.29

type UpsertTestSourceOptions testkube.TestSourceUpsertRequest

UpsertTestSourceOptions - is mapping for now to OpenAPI schema for creating test source if needed can be extended to custom struct

type UpsertTestSuiteOptions added in v0.9.5

type UpsertTestSuiteOptions testkube.TestSuiteUpsertRequest

UpsertTestSuiteOptions - mapping to OpenAPI schema for creating testsuite

type WebhookAPI added in v1.1.16

type WebhookAPI interface {
	CreateWebhook(options CreateWebhookOptions) (webhook testkube.Webhook, err error)
	GetWebhook(name string) (webhook testkube.Webhook, err error)
	ListWebhooks(selector string) (webhooks testkube.Webhooks, err error)
	DeleteWebhook(name string) (err error)
	DeleteWebhooks(selector string) (err error)
}

WebhookAPI describes webhook api methods

type WebhookClient added in v1.1.16

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

WebhookClient is a client for webhooks

func NewWebhookClient added in v1.1.16

func NewWebhookClient(webhookTransport Transport[testkube.Webhook]) WebhookClient

NewWebhookClient creates new Webhook client

func (WebhookClient) CreateWebhook added in v1.1.16

func (c WebhookClient) CreateWebhook(options CreateWebhookOptions) (webhook testkube.Webhook, err error)

CreateWebhook creates new Webhook Custom Resource

func (WebhookClient) DeleteWebhook added in v1.1.16

func (c WebhookClient) DeleteWebhook(name string) (err error)

DeleteWebhook deletes single webhook by name

func (WebhookClient) DeleteWebhooks added in v1.1.16

func (c WebhookClient) DeleteWebhooks(selector string) (err error)

DeleteWebhooks deletes all webhooks

func (WebhookClient) GetWebhook added in v1.1.16

func (c WebhookClient) GetWebhook(name string) (webhook testkube.Webhook, err error)

GetWebhook gets webhook by name

func (WebhookClient) ListWebhooks added in v1.1.16

func (c WebhookClient) ListWebhooks(selector string) (webhooks testkube.Webhooks, err error)

ListWebhooks list all webhooks

Jump to

Keyboard shortcuts

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