@@ -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
@@ -80,14 +93,28 @@ type Repository struct {
80
93
// commit id (sha) for checkout
81
94
Commit string `json:"commit,omitempty"`
82
95
// if needed we can checkout particular path (dir or file) in case of BIG/mono repositories
83
- Path string `json:"path,omitempty"`
84
- UsernameSecret * SecretRef `json:"usernameSecret,omitempty"`
85
- TokenSecret * SecretRef `json:"tokenSecret,omitempty"`
86
- CertificateSecret string `json:"certificateSecret,omitempty"`
96
+ Path string `json:"path,omitempty"`
97
+ UsernameSecret * SecretRef `json:"usernameSecret,omitempty"`
98
+ TokenSecret * SecretRef `json:"tokenSecret,omitempty"`
99
+ // git auth certificate secret for private repositories
100
+ CertificateSecret string `json:"certificateSecret,omitempty"`
87
101
// if provided we checkout the whole repository and run test from this directory
88
102
WorkingDir string `json:"workingDir,omitempty"`
103
+ // auth type for git requests
104
+ AuthType GitAuthType `json:"authType,omitempty"`
89
105
}
90
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
+
91
118
// artifact request body for container executors with test artifacts
92
119
type ArtifactRequest struct {
93
120
// artifact storage class name
@@ -101,11 +128,22 @@ type ArtifactRequest struct {
101
128
// running context for test or test suite execution
102
129
type RunningContext struct {
103
130
// One of possible context types
104
- Type_ string `json:"type"`
131
+ Type_ RunningContextType `json:"type"`
105
132
// Context value depending from its type
106
133
Context string `json:"context,omitempty"`
107
134
}
108
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
+
109
147
// test execution request body
110
148
type ExecutionRequest struct {
111
149
// test execution custom name
@@ -165,17 +203,6 @@ type ExecutionRequest struct {
165
203
RunningContext * RunningContext `json:"runningContext,omitempty"`
166
204
}
167
205
168
- type RunningContextType string
169
-
170
- const (
171
- RunningContextTypeUserCLI RunningContextType = "user-cli"
172
- RunningContextTypeUserUI RunningContextType = "user-ui"
173
- RunningContextTypeTestSuite RunningContextType = "testsuite"
174
- RunningContextTypeTestTrigger RunningContextType = "testtrigger"
175
- RunningContextTypeScheduler RunningContextType = "scheduler"
176
- RunningContextTypeEmpty RunningContextType = ""
177
- )
178
-
179
206
// Reference to env resource
180
207
type EnvReference struct {
181
208
v1.LocalObjectReference `json:"reference"`
@@ -187,6 +214,7 @@ type EnvReference struct {
187
214
MapToVariables bool `json:"mapToVariables,omitempty"`
188
215
}
189
216
217
+ // +kubebuilder:validation:Enum=queued;running;passed;failed;aborted;timeout
190
218
type ExecutionStatus string
191
219
192
220
// List of ExecutionStatus
0 commit comments