Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ijaz Ahmad
ksonnet
Commits
626d02ef
Unverified
Commit
626d02ef
authored
Apr 03, 2018
by
bryanl
Browse files
add e2e tests for built in prototypes
Signed-off-by:
bryanl
<
bryanliles@gmail.com
>
parent
560a43bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
0 deletions
+105
-0
e2e/builtin_test.go
e2e/builtin_test.go
+105
-0
No files found.
e2e/builtin_test.go
0 → 100644
View file @
626d02ef
// Copyright 2018 The ksonnet authors
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// +build e2e
package
e2e
import
(
.
"github.com/onsi/ginkgo"
)
type
builtinRunner
struct
{
prototypeName
string
options
[]
string
}
var
_
=
Describe
(
"builtin prototypes"
,
func
()
{
var
(
a
app
namespace
string
runners
=
[]
builtinRunner
{
{
prototypeName
:
"configMap"
,
options
:
[]
string
{
"--data"
,
`{"key1": "value1", "key2": "value2"}`
,
},
},
{
prototypeName
:
"deployed-service"
,
options
:
[]
string
{
"--image"
,
"gcr.io/heptio-images/ks-guestbook-demo:0.1"
,
"--type"
,
"ClusterIP"
,
},
},
{
prototypeName
:
"single-port-deployment"
,
options
:
[]
string
{
"--image"
,
"gcr.io/heptio-images/ks-guestbook-demo:0.1"
,
},
},
{
prototypeName
:
"single-port-service"
,
options
:
[]
string
{
"--targetLabelSelector"
,
`{app: "MyApp"}`
,
},
},
}
)
BeforeEach
(
func
()
{
namespace
=
e
.
createNamespace
()
io
:=
&
initOptions
{
context
:
"gke_bryan-heptio_us-central1-a_dev2"
,
namespace
:
namespace
,
}
a
=
e
.
initApp
(
io
)
})
AfterEach
(
func
()
{
e
.
removeNamespace
(
namespace
)
})
for
i
:=
range
runners
{
r
:=
runners
[
i
]
Context
(
r
.
prototypeName
,
func
()
{
JustBeforeEach
(
func
()
{
runOpts
:=
[]
string
{
"generate"
,
r
.
prototypeName
,
"unit"
,
}
runOpts
=
append
(
runOpts
,
r
.
options
...
)
o
:=
a
.
runKs
(
runOpts
...
)
assertExitStatus
(
o
,
0
)
})
It
(
"validates"
,
func
()
{
o
:=
a
.
runKs
(
"validate"
,
"default"
)
assertExitStatus
(
o
,
0
)
})
It
(
"applies to the cluster"
,
func
()
{
o
:=
a
.
runKs
(
"apply"
,
"default"
)
assertExitStatus
(
o
,
0
)
})
})
}
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment