Skip to content

Commit

Permalink
feat: make test suite steps params oss (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
vLia authored Mar 6, 2024
1 parent b7aaa27 commit d195552
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 144 deletions.
49 changes: 46 additions & 3 deletions api/testsuite/v3/testsuite_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package v3

import (
commonv1 "github.com/kubeshop/testkube-operator/api/common/v1"
"github.com/kubeshop/testkube-operator/pkg/tcl/testsuitestcl"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -53,8 +52,8 @@ type TestSuiteStepSpec struct {
// delay duration in time units
// +kubebuilder:validation:Type:=string
// +kubebuilder:validation:Format:=duration
Delay metav1.Duration `json:"delay,omitempty"`
ExecutionRequest *testsuitestcl.TestSuiteStepExecutionRequest `json:"executionRequest,omitempty"`
Delay metav1.Duration `json:"delay,omitempty"`
ExecutionRequest *TestSuiteStepExecutionRequest `json:"executionRequest,omitempty"`
}

// options to download artifacts from previous steps
Expand Down Expand Up @@ -190,3 +189,47 @@ type TestSuiteList struct {
func init() {
SchemeBuilder.Register(&TestSuite{}, &TestSuiteList{})
}

type ArgsModeType commonv1.ArgsModeType

// TestSuiteStepExecutionRequest contains parameters to be used by the executions.
// These fields will be passed to the execution when a Test Suite is queued for execution.
// TestSuiteStepExecutionRequest parameters have the highest priority. They override the
// values coming from Test Suites, Tests, and Test Executions.
// +kubebuilder:object:generate=true
type TestSuiteStepExecutionRequest struct {
// test execution labels
ExecutionLabels map[string]string `json:"executionLabels,omitempty"`
Variables map[string]Variable `json:"variables,omitempty"`
// additional executor binary arguments
Args []string `json:"args,omitempty"`
// usage mode for arguments
ArgsMode ArgsModeType `json:"argsMode,omitempty"`
// executor binary command
Command []string `json:"command,omitempty"`
// whether to start execution sync or async
Sync bool `json:"sync,omitempty"`
// http proxy for executor containers
HttpProxy string `json:"httpProxy,omitempty"`
// https proxy for executor containers
HttpsProxy string `json:"httpsProxy,omitempty"`
// negative test will fail the execution if it is a success and it will succeed if it is a failure
NegativeTest bool `json:"negativeTest,omitempty"`
// job template extensions
JobTemplate string `json:"jobTemplate,omitempty"`
// job template extensions reference
JobTemplateReference string `json:"jobTemplateReference,omitempty"`
// cron job template extensions
CronJobTemplate string `json:"cronJobTemplate,omitempty"`
// cron job template extensions reference
CronJobTemplateReference string `json:"cronJobTemplateReference,omitempty"`
// scraper template extensions
ScraperTemplate string `json:"scraperTemplate,omitempty"`
// scraper template extensions reference
ScraperTemplateReference string `json:"scraperTemplateReference,omitempty"`
// pvc template extensions
PvcTemplate string `json:"pvcTemplate,omitempty"`
// pvc template extensions reference
PvcTemplateReference string `json:"pvcTemplateReference,omitempty"`
RunningContext *commonv1.RunningContext `json:"runningContext,omitempty"`
}
48 changes: 46 additions & 2 deletions api/testsuite/v3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 0 additions & 61 deletions pkg/tcl/testsuitestcl/steps.go

This file was deleted.

78 changes: 0 additions & 78 deletions pkg/tcl/testsuitestcl/zz_generated.deepcopy.go

This file was deleted.

0 comments on commit d195552

Please sign in to comment.