MCPcopy Create free account
hub / github.com/devfile/api / TestValidateComponents

Function TestValidateComponents

pkg/validation/components_test.go:159–589  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

157}
158
159func TestValidateComponents(t *testing.T) {
160
161 volMounts := []v1alpha2.VolumeMount{
162 {
163 Name: "myvol",
164 Path: "/some/path/",
165 },
166 }
167
168 invalidVolMounts := []v1alpha2.VolumeMount{
169 {
170 Name: "myinvalidvol",
171 },
172 {
173 Name: "myinvalidvol2",
174 },
175 }
176
177 projectSourceEnv := []v1alpha2.EnvVar{
178 {
179 Name: EnvProjectsSrc,
180 Value: "/some/path/",
181 },
182 }
183
184 projectsRootEnv := []v1alpha2.EnvVar{
185 {
186 Name: EnvProjectsRoot,
187 Value: "/some/path/",
188 },
189 }
190
191 twoRemotesGitSrc := v1alpha2.DockerfileSrc{
192 Git: &v1alpha2.DockerfileGitProjectSource{
193 GitProjectSource: v1alpha2.GitProjectSource{
194 GitLikeProjectSource: v1alpha2.GitLikeProjectSource{
195 Remotes: map[string]string{
196 "a": "abc",
197 "x": "xyz",
198 },
199 CheckoutFrom: &v1alpha2.CheckoutFrom{
200 Remote: "a",
201 },
202 },
203 },
204 },
205 }
206
207 zeroRemoteGitSrc := v1alpha2.DockerfileSrc{
208 Git: &v1alpha2.DockerfileGitProjectSource{
209 GitProjectSource: v1alpha2.GitProjectSource{
210 GitLikeProjectSource: v1alpha2.GitLikeProjectSource{
211 CheckoutFrom: &v1alpha2.CheckoutFrom{
212 Remote: "a",
213 },
214 },
215 },
216 },

Callers

nothing calls this directly

Tested by

no test coverage detected