@@ -57,9 +57,10 @@ func debugAnyJenkinsFailure(br *exutil.BuildResult, name string, oc *exutil.CLI,
57
57
var _ = g .Describe ("[Feature:Builds][Slow] openshift pipeline build" , func () {
58
58
defer g .GinkgoRecover ()
59
59
var (
60
- jenkinsTemplatePath = exutil .FixturePath (".." , ".." , "examples" , "jenkins" , "jenkins-ephemeral-template.json" )
61
- mavenSlavePipelinePath = exutil .FixturePath (".." , ".." , "examples" , "jenkins" , "pipeline" , "maven-pipeline.yaml" )
62
- mavenSlaveGradlePipelinePath = exutil .FixturePath ("testdata" , "builds" , "gradle-pipeline.yaml" )
60
+ jenkinsTemplatePath = exutil .FixturePath (".." , ".." , "examples" , "jenkins" , "jenkins-ephemeral-template.json" )
61
+ nodejsDeclarativePipelinePath = exutil .FixturePath (".." , ".." , "examples" , "jenkins" , "pipeline" , "nodejs-sample-pipeline.yaml" )
62
+ mavenSlavePipelinePath = exutil .FixturePath (".." , ".." , "examples" , "jenkins" , "pipeline" , "maven-pipeline.yaml" )
63
+ mavenSlaveGradlePipelinePath = exutil .FixturePath ("testdata" , "builds" , "gradle-pipeline.yaml" )
63
64
//orchestrationPipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "mapsapp-pipeline.yaml")
64
65
blueGreenPipelinePath = exutil .FixturePath (".." , ".." , "examples" , "jenkins" , "pipeline" , "bluegreen-pipeline.yaml" )
65
66
clientPluginPipelinePath = exutil .FixturePath (".." , ".." , "examples" , "jenkins" , "pipeline" , "openshift-client-plugin-pipeline.yaml" )
@@ -230,6 +231,55 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
230
231
})
231
232
})
232
233
234
+ g .Context ("Pipelines with declarative syntax" , func () {
235
+ g .BeforeEach (func () {
236
+ setupJenkins ()
237
+
238
+ if os .Getenv (jenkins .EnableJenkinsMemoryStats ) != "" {
239
+ ticker = jenkins .StartJenkinsMemoryTracking (oc , oc .Namespace ())
240
+ }
241
+
242
+ g .By ("waiting for builder service account" )
243
+ err := exutil .WaitForBuilderAccount (oc .KubeClient ().Core ().ServiceAccounts (oc .Namespace ()))
244
+ o .Expect (err ).NotTo (o .HaveOccurred ())
245
+ })
246
+
247
+ g .AfterEach (func () {
248
+ if g .CurrentGinkgoTestDescription ().Failed {
249
+ exutil .DumpPodStates (oc )
250
+ exutil .DumpPodLogsStartingWith ("" , oc )
251
+ }
252
+ if os .Getenv (jenkins .EnableJenkinsMemoryStats ) != "" {
253
+ ticker .Stop ()
254
+ }
255
+ })
256
+
257
+ g .It ("should build successfully" , func () {
258
+ // create the bc
259
+ g .By (fmt .Sprintf ("calling oc create -f %q" , nodejsDeclarativePipelinePath ))
260
+ err := oc .Run ("create" ).Args ("-f" , nodejsDeclarativePipelinePath ).Execute ()
261
+ o .Expect (err ).NotTo (o .HaveOccurred ())
262
+
263
+ // start the build
264
+ g .By ("starting the pipeline build and waiting for it to complete" )
265
+ br , err := exutil .StartBuildAndWait (oc , "nodejs-sample-pipeline" )
266
+ if err != nil || ! br .BuildSuccess {
267
+ exutil .DumpBuilds (oc )
268
+ exutil .DumpPodLogsStartingWith ("nodejs" , oc )
269
+ exutil .DumpBuildLogs ("nodejs-mongodb-example" , oc )
270
+ exutil .DumpDeploymentLogs ("mongodb" , 1 , oc )
271
+ exutil .DumpDeploymentLogs ("nodejs-mongodb-example" , 1 , oc )
272
+ }
273
+ debugAnyJenkinsFailure (br , oc .Namespace ()+ "-nodejs-sample-pipeline" , oc , true )
274
+ br .AssertSuccess ()
275
+
276
+ // wait for the service to be running
277
+ g .By ("expecting the openshift-jee-sample service to be deployed and running" )
278
+ _ , err = exutil .GetEndpointAddress (oc , "nodejs-mongodb-example" )
279
+ o .Expect (err ).NotTo (o .HaveOccurred ())
280
+ })
281
+ })
282
+
233
283
g .Context ("Sync secret to credential" , func () {
234
284
g .BeforeEach (func () {
235
285
setupJenkins ()
0 commit comments