Skip to content

Commit 447f326

Browse files
author
Jim Minter
committed
run jenkings gradle build in memory constrained pod
1 parent e986a9e commit 447f326

File tree

3 files changed

+71
-4
lines changed

3 files changed

+71
-4
lines changed

test/extended/builds/pipeline.go

+21-4
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ func debugAnyJenkinsFailure(br *exutil.BuildResult, name string, oc *exutil.CLI,
5555
var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
5656
defer g.GinkgoRecover()
5757
var (
58-
jenkinsTemplatePath = exutil.FixturePath("..", "..", "examples", "jenkins", "jenkins-ephemeral-template.json")
59-
mavenSlavePipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "maven-pipeline.yaml")
58+
jenkinsTemplatePath = exutil.FixturePath("..", "..", "examples", "jenkins", "jenkins-ephemeral-template.json")
59+
mavenSlavePipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "maven-pipeline.yaml")
60+
mavenSlaveGradlePipelinePath = exutil.FixturePath("testdata", "builds", "gradle-pipeline.yaml")
6061
//orchestrationPipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "mapsapp-pipeline.yaml")
6162
blueGreenPipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "bluegreen-pipeline.yaml")
6263
clientPluginPipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "openshift-client-plugin-pipeline.yaml")
@@ -142,7 +143,7 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
142143
}
143144
)
144145

145-
g.Context("Pipeline with maven slave", func() {
146+
g.Context("Pipelines with maven slave", func() {
146147
g.BeforeEach(func() {
147148
setupJenkins()
148149

@@ -184,7 +185,7 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
184185
}
185186
})
186187

187-
g.It("should build and complete successfully", func() {
188+
g.It("should build a maven project and complete successfully", func() {
188189
// instantiate the template
189190
g.By(fmt.Sprintf("calling oc new-app -f %q", mavenSlavePipelinePath))
190191
err := oc.Run("new-app").Args("-f", mavenSlavePipelinePath).Execute()
@@ -207,6 +208,22 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
207208
_, err = exutil.GetEndpointAddress(oc, "openshift-jee-sample")
208209
o.Expect(err).NotTo(o.HaveOccurred())
209210
})
211+
212+
g.It("should build a gradle project and complete successfully", func() {
213+
err := oc.Run("create").Args("-f", mavenSlaveGradlePipelinePath).Execute()
214+
o.Expect(err).NotTo(o.HaveOccurred())
215+
216+
// start the build
217+
g.By("waiting for the build to complete")
218+
br := &exutil.BuildResult{Oc: oc, BuildName: "gradle-1"}
219+
err = exutil.WaitForBuildResult(oc.BuildClient().Build().Builds(oc.Namespace()), br)
220+
if err != nil || !br.BuildSuccess {
221+
exutil.DumpBuilds(oc)
222+
exutil.DumpPodLogsStartingWith("maven", oc)
223+
}
224+
debugAnyJenkinsFailure(br, oc.Namespace()+"-gradle-pipeline", oc, true)
225+
br.AssertSuccess()
226+
})
210227
})
211228

212229
g.Context("Pipeline using config map slave", func() {

test/extended/testdata/bindata.go

+35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
kind: BuildConfig
2+
apiVersion: v1
3+
metadata:
4+
name: gradle
5+
spec:
6+
strategy:
7+
type: JenkinsPipeline
8+
jenkinsPipelineStrategy:
9+
jenkinsfile: |-
10+
node("maven") {
11+
git url: "https://github.com/openshift/gs-spring-boot-spock.git"
12+
sh "./gradlew build"
13+
}
14+
triggers:
15+
- type: ConfigChange

0 commit comments

Comments
 (0)