mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-31 01:10:20 -06:00
ci: split e2e test pipeline (#6817)
This commit is contained in:
90
.drone.star
90
.drone.star
@@ -1104,6 +1104,17 @@ def uiTestPipeline(ctx, filterTags, runPart = 1, numberOfParts = 1, storage = "o
|
||||
}
|
||||
|
||||
def e2eTests(ctx):
|
||||
test_suites = {
|
||||
"suite1": {
|
||||
"path": "tests/e2e/cucumber/features/*/*[!.oc10].feature",
|
||||
"tikaNeeded": True,
|
||||
},
|
||||
"suite2": {
|
||||
"path": "tests/e2e/cucumber/features/smoke/*/*[!.oc10].feature",
|
||||
"tikaNeeded": False,
|
||||
},
|
||||
}
|
||||
|
||||
e2e_trigger = {
|
||||
"ref": [
|
||||
"refs/heads/master",
|
||||
@@ -1123,50 +1134,51 @@ def e2eTests(ctx):
|
||||
"temp": {},
|
||||
}]
|
||||
|
||||
e2e_test_ocis = [{
|
||||
"name": "e2e-tests",
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"BASE_URL_OCIS": "ocis-server:9200",
|
||||
"HEADLESS": "true",
|
||||
"OCIS": "true",
|
||||
"RETRY": "1",
|
||||
"WEB_UI_CONFIG": "%s/%s" % (dirs["base"], dirs["ocisConfig"]),
|
||||
"LOCAL_UPLOAD_DIR": "/uploads",
|
||||
"API_TOKEN": "true",
|
||||
},
|
||||
"commands": [
|
||||
"cd %s" % dirs["web"],
|
||||
"sleep 10 && pnpm test:e2e:cucumber tests/e2e/cucumber/**/*[!.oc10].feature",
|
||||
],
|
||||
}]
|
||||
|
||||
e2eTestsSteps = \
|
||||
skipIfUnchanged(ctx, "e2e-tests") + \
|
||||
restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + \
|
||||
restoreWebCache() + \
|
||||
restoreWebPnpmCache() + \
|
||||
tikaService() + \
|
||||
ocisServer("ocis", 4, [], tika_enabled = True) + \
|
||||
e2e_test_ocis + \
|
||||
uploadTracingResult(ctx) + \
|
||||
logTracingResults()
|
||||
pipelines = []
|
||||
|
||||
if ("skip-e2e" in ctx.build.title.lower()):
|
||||
return []
|
||||
|
||||
if (ctx.build.event != "tag"):
|
||||
return [{
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "e2e-tests",
|
||||
"steps": e2eTestsSteps,
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)] + buildWebCache(ctx)),
|
||||
"trigger": e2e_trigger,
|
||||
"volumes": e2e_volumes,
|
||||
}]
|
||||
for name, suite in test_suites.items():
|
||||
steps = \
|
||||
skipIfUnchanged(ctx, "e2e-tests") + \
|
||||
restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + \
|
||||
restoreWebCache() + \
|
||||
restoreWebPnpmCache() + \
|
||||
(tikaService() if suite["tikaNeeded"] else []) + \
|
||||
ocisServer("ocis", 4, [], tika_enabled = suite["tikaNeeded"]) + \
|
||||
[{
|
||||
"name": "e2e-tests",
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"BASE_URL_OCIS": "ocis-server:9200",
|
||||
"HEADLESS": "true",
|
||||
"OCIS": "true",
|
||||
"RETRY": "1",
|
||||
"WEB_UI_CONFIG": "%s/%s" % (dirs["base"], dirs["ocisConfig"]),
|
||||
"LOCAL_UPLOAD_DIR": "/uploads",
|
||||
"API_TOKEN": "true",
|
||||
},
|
||||
"commands": [
|
||||
"cd %s" % dirs["web"],
|
||||
"pnpm test:e2e:cucumber %s" % suite["path"],
|
||||
],
|
||||
}] + \
|
||||
uploadTracingResult(ctx) + \
|
||||
logTracingResults()
|
||||
|
||||
return []
|
||||
if (ctx.build.event != "tag"):
|
||||
pipelines.append({
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "e2e-tests-%s" % name,
|
||||
"steps": steps,
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)] + buildWebCache(ctx)),
|
||||
"trigger": e2e_trigger,
|
||||
"volumes": e2e_volumes,
|
||||
})
|
||||
|
||||
return pipelines
|
||||
|
||||
def uploadTracingResult(ctx):
|
||||
return [{
|
||||
|
||||
Reference in New Issue
Block a user