-
Notifications
You must be signed in to change notification settings - Fork 0
/
no_outputname.go
68 lines (54 loc) · 2.23 KB
/
no_outputname.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package builds
import (
"fmt"
g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"
exutil "github.com/openshift/origin/test/extended/util"
)
var _ = g.Describe("[Feature:Builds][Conformance] build without output image", func() {
defer g.GinkgoRecover()
var (
dockerImageFixture = exutil.FixturePath("testdata", "builds", "test-docker-no-outputname.json")
s2iImageFixture = exutil.FixturePath("testdata", "builds", "test-s2i-no-outputname.json")
oc = exutil.NewCLI("build-no-outputname", exutil.KubeConfigPath())
)
g.Context("", func() {
g.BeforeEach(func() {
exutil.PreTestDump()
})
g.AfterEach(func() {
if g.CurrentGinkgoTestDescription().Failed {
exutil.DumpPodStates(oc)
exutil.DumpConfigMapStates(oc)
exutil.DumpPodLogsStartingWith("", oc)
}
})
g.Describe("building from templates", func() {
g.It(fmt.Sprintf("should create an image from a docker template without an output image reference defined"), func() {
err := oc.Run("create").Args("-f", dockerImageFixture).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
g.By("expecting build to pass without an output image reference specified")
br, err := exutil.StartBuildAndWait(oc, "test-docker")
br.AssertSuccess()
g.By("verifying the build test-docker-1 output")
buildLog, err := br.Logs()
fmt.Fprintf(g.GinkgoWriter, "\nBuild log:\n%s\n", buildLog)
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(buildLog).Should(o.ContainSubstring(`Build complete, no image push requested`))
})
g.It(fmt.Sprintf("should create an image from a S2i template without an output image reference defined"), func() {
err := oc.Run("create").Args("-f", s2iImageFixture).Execute()
o.Expect(err).NotTo(o.HaveOccurred())
g.By("expecting build to pass without an output image reference specified")
br, err := exutil.StartBuildAndWait(oc, "test-sti")
o.Expect(err).NotTo(o.HaveOccurred())
br.AssertSuccess()
g.By("verifying the build test-sti-1 output")
buildLog, err := br.Logs()
fmt.Fprintf(g.GinkgoWriter, "\nBuild log:\n%s\n", buildLog)
o.Expect(err).NotTo(o.HaveOccurred())
o.Expect(buildLog).Should(o.ContainSubstring(`Build complete, no image push requested`))
})
})
})
})