@@ -50,7 +50,7 @@ type Variable commonv1.Variable
50
50
// TestContent defines test content
51
51
type TestContent struct {
52
52
// test type
53
- Type_ string `json:"type,omitempty"`
53
+ Type_ TestContentType `json:"type,omitempty"`
54
54
// repository of test content
55
55
Repository * Repository `json:"repository,omitempty"`
56
56
// test content body
@@ -59,6 +59,19 @@ type TestContent struct {
59
59
Uri string `json:"uri,omitempty"`
60
60
}
61
61
62
+ // +kubebuilder:validation:Enum=string;file-uri;git-file;git-dir;git
63
+ type TestContentType string
64
+
65
+ const (
66
+ TestContentTypeString TestContentType = "string"
67
+ TestContentTypeFileURI TestContentType = "file-uri"
68
+ // Deprecated: use git instead
69
+ TestContentTypeGitFile TestContentType = "git-file"
70
+ // Deprecated: use git instead
71
+ TestContentTypeGitDir TestContentType = "git-dir"
72
+ TestContentTypeGit TestContentType = "git"
73
+ )
74
+
62
75
// Testkube internal reference for secret storage in Kubernetes secrets
63
76
type SecretRef struct {
64
77
// object kubernetes namespace
@@ -88,9 +101,20 @@ type Repository struct {
88
101
// if provided we checkout the whole repository and run test from this directory
89
102
WorkingDir string `json:"workingDir,omitempty"`
90
103
// auth type for git requests
91
- AuthType string `json:"authType,omitempty"`
104
+ AuthType GitAuthType `json:"authType,omitempty"`
92
105
}
93
106
107
+ // GitAuthType defines git auth type
108
+ // +kubebuilder:validation:Enum=basic;header
109
+ type GitAuthType string
110
+
111
+ const (
112
+ // GitAuthTypeBasic for git basic auth requests
113
+ GitAuthTypeBasic GitAuthType = "basic"
114
+ // GitAuthTypeHeader for git header auth requests
115
+ GitAuthTypeHeader GitAuthType = "header"
116
+ )
117
+
94
118
// artifact request body for container executors with test artifacts
95
119
type ArtifactRequest struct {
96
120
// artifact storage class name
@@ -104,11 +128,22 @@ type ArtifactRequest struct {
104
128
// running context for test or test suite execution
105
129
type RunningContext struct {
106
130
// One of possible context types
107
- Type_ string `json:"type"`
131
+ Type_ RunningContextType `json:"type"`
108
132
// Context value depending from its type
109
133
Context string `json:"context,omitempty"`
110
134
}
111
135
136
+ type RunningContextType string
137
+
138
+ const (
139
+ RunningContextTypeUserCLI RunningContextType = "user-cli"
140
+ RunningContextTypeUserUI RunningContextType = "user-ui"
141
+ RunningContextTypeTestSuite RunningContextType = "testsuite"
142
+ RunningContextTypeTestTrigger RunningContextType = "testtrigger"
143
+ RunningContextTypeScheduler RunningContextType = "scheduler"
144
+ RunningContextTypeEmpty RunningContextType = ""
145
+ )
146
+
112
147
// test execution request body
113
148
type ExecutionRequest struct {
114
149
// test execution custom name
@@ -168,17 +203,6 @@ type ExecutionRequest struct {
168
203
RunningContext * RunningContext `json:"runningContext,omitempty"`
169
204
}
170
205
171
- type RunningContextType string
172
-
173
- const (
174
- RunningContextTypeUserCLI RunningContextType = "user-cli"
175
- RunningContextTypeUserUI RunningContextType = "user-ui"
176
- RunningContextTypeTestSuite RunningContextType = "testsuite"
177
- RunningContextTypeTestTrigger RunningContextType = "testtrigger"
178
- RunningContextTypeScheduler RunningContextType = "scheduler"
179
- RunningContextTypeEmpty RunningContextType = ""
180
- )
181
-
182
206
// Reference to env resource
183
207
type EnvReference struct {
184
208
v1.LocalObjectReference `json:"reference"`
@@ -190,6 +214,7 @@ type EnvReference struct {
190
214
MapToVariables bool `json:"mapToVariables,omitempty"`
191
215
}
192
216
217
+ // +kubebuilder:validation:Enum=queued;running;passed;failed;aborted;timeout
193
218
type ExecutionStatus string
194
219
195
220
// List of ExecutionStatus
0 commit comments