Skip to content

Commit 948be79

Browse files
committed
ci: update drone config
1 parent f1aa0d4 commit 948be79

File tree

1 file changed

+25
-58
lines changed

1 file changed

+25
-58
lines changed

.drone.star

+25-58
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ config = {
113113
},
114114
},
115115
"skip_in_pr": True,
116-
"skip": True,
116+
"skip": False,
117117
},
118118
"ocis": {
119119
"version": "5.0",
@@ -126,7 +126,6 @@ config = {
126126
}
127127

128128
def main(ctx):
129-
return gui_test_pipeline(ctx)
130129
pipelines = check_starlark() + \
131130
gui_tests_format() + \
132131
changelog(ctx)
@@ -200,7 +199,7 @@ def gui_test_pipeline(ctx):
200199
"--testsuite %s" % dir["guiTest"],
201200
"--reportgen html,%s" % dir["guiTestReport"],
202201
"--envvar QT_LOGGING_RULES=sync.httplogger=true;gui.socketapi=false",
203-
"--tags ~@skip --tags @only",
202+
"--tags ~@skip",
204203
"--tags ~@skipOnLinux",
205204
]
206205

@@ -219,51 +218,29 @@ def gui_test_pipeline(ctx):
219218
squish_parameters.append("--tags %s" % params["tags"])
220219
squish_parameters = " ".join(squish_parameters)
221220

222-
step_skip_if_changed = skipIfUnchanged(ctx, "gui-tests")
223-
step_build_client = pipelinesDependsOn(build_client(OC_CI_SQUISH, False), step_skip_if_changed)
224-
step_wait_for_middleware = pipelinesDependsOn(waitForService("middleware", ["testmiddleware:3000"]), step_skip_if_changed)
221+
steps = skipIfUnchanged(ctx, "gui-tests") + \
222+
build_client(OC_CI_SQUISH, False)
225223

226-
step_wait_for_server = []
227-
steps = step_skip_if_changed + \
228-
pipelinesDependsOn(testMiddlewareService(server), step_skip_if_changed) + \
229-
step_wait_for_middleware + \
230-
step_build_client
224+
services = testMiddlewareService(server)
231225

232226
if server == "oc10":
233-
step_wait_for_services = pipelinesDependsOn(waitForService("services", ["mysql:3306", "owncloud:80"]), step_skip_if_changed)
234-
step_install_oc10 = pipelinesDependsOn(installOC10(params["version"]), step_wait_for_services)
235-
step_setup_oc10 = pipelinesDependsOn(setupServerAndApp(), step_install_oc10)
236-
step_install_extra_apps = pipelinesDependsOn(installExtraApps(params["extra_apps"]), step_setup_oc10)
237-
step_fix_permissions = pipelinesDependsOn(fixPermissions(), step_install_extra_apps)
238-
239-
steps += pipelinesDependsOn(owncloudService(), step_skip_if_changed) + \
240-
pipelinesDependsOn(databaseService(), step_skip_if_changed) + \
241-
step_wait_for_services + \
242-
step_install_oc10 + \
243-
step_setup_oc10 + \
244-
step_install_extra_apps + \
245-
step_fix_permissions + \
227+
steps += installCore(params["version"]) + \
228+
setupServerAndApp() + \
229+
installExtraApps(params["extra_apps"]) + \
230+
fixPermissions() + \
246231
owncloudLog()
247-
step_wait_for_server = step_fix_permissions
232+
services += owncloudService() + \
233+
databaseService()
248234
else:
249-
step_ocis_server = pipelinesDependsOn(ocisService(params["version"]), step_skip_if_changed)
250-
step_wait_for_ocis = pipelinesDependsOn(waitForService("ocis", ["ocis:9200"]), step_skip_if_changed)
251-
steps += step_ocis_server + \
252-
step_wait_for_ocis
253-
step_wait_for_server = step_wait_for_ocis
254-
255-
step_install_pnpm = pipelinesDependsOn(installPnpm(), step_skip_if_changed)
256-
step_install_python_modules = pipelinesDependsOn(install_python_modules(), step_build_client)
257-
step_gui_report_dir = pipelinesDependsOn(setGuiTestReportDir(), step_skip_if_changed)
258-
step_gui_tests = pipelinesDependsOn(gui_tests(squish_parameters, server), step_wait_for_server + step_install_pnpm + step_install_python_modules + step_gui_report_dir)
259-
step_upload_test_reports = pipelinesDependsOn(uploadGuiTestLogs(ctx, server), step_gui_tests)
260-
261-
steps += step_install_pnpm + \
262-
step_install_python_modules + \
263-
step_gui_report_dir + \
264-
step_gui_tests + \
265-
step_upload_test_reports + \
266-
pipelinesDependsOn(logGuiReports(ctx, server), step_upload_test_reports)
235+
steps += ocisService(params["version"]) + \
236+
waitForService("ocis", "ocis:9200")
237+
238+
steps += installPnpm() + \
239+
install_python_modules() + \
240+
setGuiTestReportDir() + \
241+
gui_tests(squish_parameters, server) + \
242+
uploadGuiTestLogs(ctx, server) + \
243+
logGuiReports(ctx, server)
267244

268245
pipelines.append({
269246
"kind": "pipeline",
@@ -273,6 +250,7 @@ def gui_test_pipeline(ctx):
273250
"arch": "amd64",
274251
},
275252
"steps": steps,
253+
"services": services,
276254
"trigger": {
277255
"ref": trigger_ref,
278256
},
@@ -498,7 +476,6 @@ def databaseService():
498476
return [{
499477
"name": "mysql",
500478
"image": MYSQL,
501-
"detach": True,
502479
"environment": {
503480
"MYSQL_USER": "owncloud",
504481
"MYSQL_PASSWORD": "owncloud",
@@ -508,7 +485,7 @@ def databaseService():
508485
"command": ["--default-authentication-plugin=mysql_native_password"],
509486
}]
510487

511-
def installOC10(server_version = "latest"):
488+
def installCore(server_version = "latest"):
512489
return [{
513490
"name": "install-core",
514491
"image": OC_CI_CORE,
@@ -559,7 +536,6 @@ def owncloudService():
559536
return [{
560537
"name": "owncloud",
561538
"image": OC_CI_PHP % DEFAULT_PHP_VERSION,
562-
"detach": True,
563539
"environment": {
564540
"APACHE_WEBROOT": dir["server"],
565541
"APACHE_CONFIG_TEMPLATE": "ssl",
@@ -592,7 +568,6 @@ def testMiddlewareService(server_type = "oc10"):
592568
"name": "testmiddleware",
593569
"image": OC_TEST_MIDDLEWARE,
594570
"environment": environment,
595-
"detach": True,
596571
"volumes": [{
597572
"name": "uploads",
598573
"path": "/uploads",
@@ -641,16 +616,9 @@ def ocisService(server_version = "latest"):
641616
],
642617
}]
643618

644-
def waitForOcisService():
645-
return [{
646-
"name": "wait-for-ocis",
647-
"image": OC_CI_WAIT_FOR,
648-
"commands": [
649-
"wait-for -it ocis:9200 -t 300",
650-
],
651-
}]
652-
653-
def waitForService(name, servers = []):
619+
def waitForService(name, servers):
620+
if type(servers) == "string":
621+
servers = [servers]
654622
return [{
655623
"name": "wait-for-%s" % name,
656624
"image": OC_CI_WAIT_FOR,
@@ -682,7 +650,6 @@ def install_python_modules():
682650
"user": "0:0",
683651
"commands": [
684652
"make -C %s pip-install" % dir["guiTest"],
685-
"python3.10 -m pip list -v",
686653
],
687654
"volumes": pip_step_volume + pip_step64_volume,
688655
}]

0 commit comments

Comments
 (0)