@@ -201,29 +201,51 @@ def gui_test_pipeline(ctx):
201
201
if params ["tags" ]:
202
202
squish_parameters += " --tags %s" % params ["tags" ]
203
203
204
- steps = skipIfUnchanged (ctx , "gui-tests" ) + \
205
- build_client (OC_CI_SQUISH , False )
204
+ step_skip_if_changed = skipIfUnchanged (ctx , "gui-tests" )
205
+ step_build_client = pipelinesDependsOn (build_client (OC_CI_SQUISH , False ), step_skip_if_changed )
206
+ step_wait_for_middleware = pipelinesDependsOn (waitForService ("middleware" , ["testmiddleware:3000" ]), step_skip_if_changed )
206
207
207
- services = testMiddlewareService (server )
208
+ step_wait_for_server = []
209
+ steps = step_skip_if_changed + \
210
+ pipelinesDependsOn (testMiddlewareService (server ), step_skip_if_changed ) + \
211
+ step_wait_for_middleware + \
212
+ step_build_client
208
213
209
214
if server == "oc10" :
210
- steps += installCore (params ["version" ]) + \
211
- setupServerAndApp () + \
212
- installExtraApps (params ["extra_apps" ]) + \
213
- fixPermissions () + \
215
+ step_wait_for_services = pipelinesDependsOn (waitForService ("services" , ["mysql:3306" , "owncloud:80" ]), step_skip_if_changed )
216
+ step_install_oc10 = pipelinesDependsOn (installOC10 (params ["version" ]), step_wait_for_services )
217
+ step_setup_oc10 = pipelinesDependsOn (setupServerAndApp (), step_install_oc10 )
218
+ step_install_extra_apps = pipelinesDependsOn (installExtraApps (params ["extra_apps" ]), step_setup_oc10 )
219
+ step_fix_permissions = pipelinesDependsOn (fixPermissions (), step_install_extra_apps )
220
+
221
+ steps += pipelinesDependsOn (owncloudService (), step_skip_if_changed ) + \
222
+ pipelinesDependsOn (databaseService (), step_skip_if_changed ) + \
223
+ step_wait_for_services + \
224
+ step_install_oc10 + \
225
+ step_setup_oc10 + \
226
+ step_install_extra_apps + \
227
+ step_fix_permissions + \
214
228
owncloudLog ()
215
- services += owncloudService () + \
216
- databaseService ()
229
+ step_wait_for_server = step_fix_permissions
217
230
else :
218
- steps += ocisService (params ["version" ]) + \
219
- waitForOcisService ()
220
-
221
- steps += installPnpm () + \
222
- install_python_modules () + \
223
- setGuiTestReportDir () + \
224
- gui_tests (squish_parameters , server ) + \
225
- uploadGuiTestLogs (ctx , server ) + \
226
- logGuiReports (ctx , server )
231
+ step_ocis_server = pipelinesDependsOn (ocisService (params ["version" ]), step_skip_if_changed )
232
+ step_wait_for_ocis = pipelinesDependsOn (waitForService ("ocis" , ["ocis:9200" ]), step_skip_if_changed )
233
+ steps += step_ocis_server + \
234
+ step_wait_for_ocis
235
+ step_wait_for_server = step_wait_for_ocis
236
+
237
+ step_install_pnpm = pipelinesDependsOn (installPnpm (), step_skip_if_changed )
238
+ step_install_python_modules = pipelinesDependsOn (install_python_modules (), step_build_client )
239
+ step_gui_report_dir = pipelinesDependsOn (setGuiTestReportDir (), step_skip_if_changed )
240
+ step_gui_tests = pipelinesDependsOn (gui_tests (squish_parameters , server ), step_wait_for_server + step_install_pnpm + step_install_python_modules + step_gui_report_dir )
241
+ step_upload_test_reports = pipelinesDependsOn (uploadGuiTestLogs (ctx , server ), step_gui_tests )
242
+
243
+ steps += step_install_pnpm + \
244
+ step_install_python_modules + \
245
+ step_gui_report_dir + \
246
+ step_gui_tests + \
247
+ step_upload_test_reports + \
248
+ pipelinesDependsOn (logGuiReports (ctx , server ), step_upload_test_reports )
227
249
228
250
pipelines .append ({
229
251
"kind" : "pipeline" ,
@@ -233,7 +255,6 @@ def gui_test_pipeline(ctx):
233
255
"arch" : "amd64" ,
234
256
},
235
257
"steps" : steps ,
236
- "services" : services ,
237
258
"trigger" : {
238
259
"ref" : trigger_ref ,
239
260
},
@@ -468,7 +489,7 @@ def databaseService():
468
489
"command" : ["--default-authentication-plugin=mysql_native_password" ],
469
490
}]
470
491
471
- def installCore (server_version = "latest" ):
492
+ def installOC10 (server_version = "latest" ):
472
493
return [{
473
494
"name" : "install-core" ,
474
495
"image" : OC_CI_CORE ,
@@ -551,6 +572,7 @@ def testMiddlewareService(server_type = "oc10"):
551
572
"name" : "testmiddleware" ,
552
573
"image" : OC_TEST_MIDDLEWARE ,
553
574
"environment" : environment ,
575
+ "detach" : True ,
554
576
"volumes" : [{
555
577
"name" : "uploads" ,
556
578
"path" : "/uploads" ,
@@ -608,6 +630,15 @@ def waitForOcisService():
608
630
],
609
631
}]
610
632
633
+ def waitForService (name , servers = []):
634
+ return [{
635
+ "name" : "wait-for-%s" % name ,
636
+ "image" : OC_CI_WAIT_FOR ,
637
+ "commands" : [
638
+ "wait-for -it %s -t 300" % "," .join (servers ),
639
+ ],
640
+ }]
641
+
611
642
def installPnpm ():
612
643
return [{
613
644
"name" : "pnpm-install" ,
0 commit comments