Unverified Commit 74e03a64 authored by Bryan Liles's avatar Bryan Liles Committed by GitHub
Browse files

Merge pull request #417 from bryanl/add-e2e-for-built-in-prototypes

Add e2e for built in prototypes
parents 560a43bd c917b73c
......@@ -261,7 +261,7 @@
"ksonnet-gen/nodemaker",
"ksonnet-gen/printer"
]
revision = "a00919f41c5221e894db7c67b51b1338a649df4b"
revision = "f1aa55533283d55b2967f1e2cfb47048cf6661c8"
[[projects]]
name = "github.com/magiconair/properties"
......@@ -675,6 +675,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "12c28be36adc447c9dfceffe28256a3ec5c0709379755082872b981f309857ee"
inputs-digest = "c16f38b5c4be37f44ba1042794a39c1b505798fbefdcf8b05844509b47313a9d"
solver-name = "gps-cdcl"
solver-version = 1
......@@ -54,7 +54,7 @@
[[constraint]]
name = "github.com/ksonnet/ksonnet-lib"
revision = "a00919f41c5221e894db7c67b51b1338a649df4b"
revision = "f1aa55533283d55b2967f1e2cfb47048cf6661c8"
[[constraint]]
name = "github.com/mattn/go-isatty"
......
// 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)
})
})
}
})
......@@ -54,6 +54,7 @@ var (
*newConstructor(
"new",
*newConstructorParam("name", "mixin.metadata.withName", nil),
*newConstructorParam("data", "withData", nil),
),
},
makeDescriptor("api", "core", "ConfigMapList"): objectList,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment