Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci]Run ocm with collaboration service in CI #11823

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 45 additions & 23 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,23 @@ config = {
"e2e": {
"1": {
"earlyFail": True,
"skip": False,
"skip": True,
"suites": [
"journeys",
"smoke",
],
},
"2": {
"earlyFail": True,
"skip": False,
"skip": True,
"suites": [
"admin-settings",
"spaces",
],
},
"3": {
"earlyFail": True,
"skip": False,
"skip": True,
"tikaNeeded": True,
"suites": [
"search",
Expand All @@ -86,15 +86,15 @@ config = {
},
"4": {
"earlyFail": True,
"skip": False,
"skip": True,
"suites": [
"navigation",
"user-settings",
"file-action",
],
},
"app-provider": {
"skip": False,
"skip": True,
"suites": [
"app-provider",
],
Expand All @@ -111,7 +111,7 @@ config = {
},
},
"oidc-refresh-token": {
"skip": False,
"skip": True,
"features": [
"cucumber/features/oidc/refreshToken.feature",
],
Expand All @@ -121,7 +121,7 @@ config = {
},
},
"oidc-iframe": {
"skip": False,
"skip": True,
"features": [
"cucumber/features/oidc/iframeTokenRenewal.feature",
],
Expand All @@ -137,6 +137,13 @@ config = {
"ocm",
],
"extraServerEnvironment": {
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
"MICRO_REGISTRY": "nats-js-kv",
"MICRO_REGISTRY_ADDRESS": "0.0.0.0:9233",
"NATS_NATS_HOST": "0.0.0.0",
"NATS_NATS_PORT": 9233,
"COLLABORA_DOMAIN": "collabora:9980",
"FRONTEND_APP_HANDLER_SECURE_VIEW_APP_ADDR": "com.owncloud.api.collaboration.Collabora",
"OCIS_ADD_RUN_SERVICES": "ocm",
"OCIS_ENABLE_OCM": True,
"GRAPH_INCLUDE_OCM_SHAREES": True,
Expand Down Expand Up @@ -209,9 +216,6 @@ def main(ctx):

def beforePipelines(ctx):
return checkStarlark() + \
licenseCheck(ctx) + \
documentation(ctx) + \
changelog(ctx) + \
pnpmCache(ctx) + \
cacheOcisPipeline(ctx) + \
pipelinesDependsOn(buildCacheWeb(ctx), pnpmCache(ctx)) + \
Expand All @@ -226,7 +230,7 @@ def stagePipelines(ctx):

e2e_pipelines = e2eTests(ctx)
keycloak_pipelines = e2eTestsOnKeycloak(ctx)
return unit_test_pipelines + buildAndTestDesignSystem(ctx) + pipelinesDependsOn(e2e_pipelines + keycloak_pipelines, unit_test_pipelines)
return e2e_pipelines

def afterPipelines(ctx):
return build(ctx) + pipelinesDependsOn(notify(), build(ctx))
Expand Down Expand Up @@ -626,8 +630,15 @@ def e2eTests(ctx):
wopiCollaborationService("onlyoffice") + \
waitForServices("wopi", ["wopi-collabora:9300", "wopi-onlyoffice:9300"])
elif "ocm" in suite:
steps += ocisService(params["extraServerEnvironment"]) + \
(ocisService(params["extraServerEnvironment"], "federation") if params["federationServer"] else [])
environment["FAIL_ON_UNCAUGHT_CONSOLE_ERR"] = False
steps += collaboraService() + \
collaboraService("federation") + \
waitForServices("online-offices", ["collabora:9980", "collabora-federation:9980"]) + \
ocisService(params["extraServerEnvironment"]) + \
(ocisService(params["extraServerEnvironment"], "federation") if params["federationServer"] else []) + \
wopiCollaborationService("collabora") + \
wopiCollaborationService("collabora", "federation") + \
waitForServices("wopi", ["wopi-collabora:9300", "wopi-federation-collabora:9300"])
else:
# oCIS specific steps
steps += (tikaService() if params["tikaNeeded"] else []) + \
Expand Down Expand Up @@ -938,8 +949,12 @@ def documentation(ctx):
]

def ocisService(extra_env_config = {}, deploy_type = "ocis"):
container_name = "ocis"

environment = {
"IDM_ADMIN_PASSWORD": "admin", # override the random admin password from `ocis init`
"OCIS_URL": "https://ocis:9200",
"WEB_UI_CONFIG_FILE": dir["ocisConfig"],
"OCIS_INSECURE": "true",
"OCIS_LOG_LEVEL": "error",
"OCIS_JWT_SECRET": "some-ocis-jwt-secret",
Expand All @@ -958,14 +973,9 @@ def ocisService(extra_env_config = {}, deploy_type = "ocis"):
if deploy_type == "federation":
environment["OCIS_URL"] = "https://federation-ocis:10200"
environment["PROXY_HTTP_ADDR"] = "federation-ocis:10200"
environment["COLLABORA_DOMAIN"] = "collabora-federation:9980"
environment["WEB_UI_CONFIG_FILE"] = dir["federatedOcisConfig"]
container_name = "federation-ocis"
ocis_domain = "federation-ocis:10200"
else:
container_name = "ocis"
ocis_domain = "ocis:9200"
environment["OCIS_URL"] = "https://ocis:9200"
environment["WEB_UI_CONFIG_FILE"] = dir["ocisConfig"]

for config in extra_env_config:
environment[config] = extra_env_config[config]
Expand Down Expand Up @@ -1605,16 +1615,22 @@ def tikaService():
"detach": True,
}] + waitForServices("tika", ["tika:9998"])

def collaboraService():
def collaboraService(deploy_type = "ocis"):
service_name = "collabora"
ancestor_url = "https://ocis:9200"
if deploy_type == "federation":
service_name = "collabora-federation"
ancestor_url = "https://federation-ocis:10200"

return [
{
"name": "collabora",
"name": service_name,
"type": "docker",
"image": COLLABORA_CODE,
"detach": True,
"environment": {
"DONT_GEN_SSL_CERT": "set",
"extra_params": "--o:ssl.enable=true --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=https://ocis:9200",
"extra_params": "--o:ssl.enable=true --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=%s" % ancestor_url,
},
"commands": [
"coolconfig generate-proof-key",
Expand Down Expand Up @@ -1646,7 +1662,7 @@ def onlyofficeService():
},
]

def wopiCollaborationService(name):
def wopiCollaborationService(name, deploy_type = "ocis"):
service_name = "wopi-%s" % name
environment = {
"MICRO_REGISTRY": "nats-js-kv",
Expand All @@ -1657,8 +1673,14 @@ def wopiCollaborationService(name):
"COLLABORATION_CS3API_DATAGATEWAY_INSECURE": True,
"OCIS_JWT_SECRET": "some-ocis-jwt-secret",
"COLLABORATION_WOPI_SECRET": "some-wopi-secret",
"OCIS_URL": "https://ocis:9200",
}

if deploy_type == "federation":
environment["OCIS_URL"] = "https://federation-ocis:10200"
environment["MICRO_REGISTRY_ADDRESS"] = "federation-ocis:9233"
service_name = "wopi-federation-%s" % name

if name == "collabora":
environment["COLLABORATION_APP_NAME"] = "Collabora"
environment["COLLABORATION_APP_ADDR"] = "https://collabora:9980"
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/cucumber/features/ocm/ocm.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Feature: federation management
| filesForUpload/testavatar.jpg | testavatar.jpg |
| filesForUpload/sampleGif.gif | sampleGif.gif |
And "Alice" logs in
When "Alice" creates the following resources
| resource | type | content |
| OpenDocument.odt | OpenDocument | OpenDocument Content |
And "Alice" opens the "open-cloud-mesh" app
And "Alice" generates invitation token for the federation share

Expand Down