From 9269643c0ebc08bcebe9b5cf441cfefcf5140e7d Mon Sep 17 00:00:00 2001 From: Prajwol Amatya <83579989+PrajwolAmatya@users.noreply.github.com> Date: Tue, 13 Oct 2026 16:23:20 +0545 Subject: [PATCH] [tests-only][full-ci][k8s] test: run e2e app-provider with k8s setup (#13046) * test: run e2e app-provider with k8s setup Signed-off-by: Prajwol Amatya * test: limit app-registry mimetypes Signed-off-by: Prajwol Amatya * test: add host for onlyoffice Signed-off-by: Prajwol Amatya * test: enable secure view Signed-off-by: Prajwol Amatya * test: add available unified roles Signed-off-by: Prajwol Amatya --------- Signed-off-by: Prajwol Amatya --- .github/workflows/k8s.yml | 77 ++++++++++++++++++++++++++++++++++-- tests/config/k8s/setup.sh | 1 + tests/config/k8s/values.yaml | 29 +++++++++++++- 3 files changed, 103 insertions(+), 4 deletions(-) diff --git a/.github/workflows/k8s.yml b/.github/workflows/k8s.yml index d48b9bb48cd..f28a0a03eee 100644 --- a/.github/workflows/k8s.yml +++ b/.github/workflows/k8s.yml @@ -482,9 +482,9 @@ jobs: # - suite: oidc-iframe # args: "--type playwright specs/oidc/iframeTokenRenewal.spec.ts" # oidc_iframe: true - # - suite: app-provider - # args: "--type playwright --suites app-provider" - # collaboration: true + - suite: app-provider + args: "--type playwright --suites app-provider" + collaboration: true # - suite: ocm # args: "--type playwright --suites ocm" # federated: true @@ -540,14 +540,84 @@ jobs: run: make -C tests/config/k8s create-cluster - name: Prepare Helm Charts + env: + ENABLE_WOPI: ${{ matrix.suite == 'app-provider' }} run: make -C tests/config/k8s prepare-charts + - name: Deploy Suite-Specific External Backends + run: | + if [[ "${{ matrix.suite }}" == "app-provider" ]]; then + # Start Collabora + docker run -d \ + --name collabora \ + --network host \ + --entrypoint bash \ + -e DONT_GEN_SSL_CERT=set \ + -e "extra_params=--o:ssl.enable=true --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=https://127.0.0.1:9200" \ + collabora/code:25.04.7.3.1 \ + -c "coolconfig generate-proof-key && bash /start-collabora-online.sh" + timeout 150 bash -c 'until curl -kfsSL https://localhost:9980/hosting/discovery > /dev/null; do sleep 5; done' + echo "collabora ready." + + # Start OnlyOffice + docker run -d \ + --name onlyoffice \ + -p 7443:443 \ + --add-host "$TEST_SERVER_DOMAIN:host-gateway" \ + -e WOPI_ENABLED=true \ + -e USE_UNAUTHORIZED_STORAGE=true \ + -v "$(pwd)/tests/config/ci/only-office.json:/tmp/local.json:ro" \ + --entrypoint /bin/sh \ + onlyoffice/documentserver:9.2.1 \ + -c "set -e + cp /tmp/local.json /etc/onlyoffice/documentserver/local.json + openssl req -x509 -newkey rsa:4096 -keyout onlyoffice.key -out onlyoffice.crt -sha256 -days 365 -batch -nodes + mkdir -p /var/www/onlyoffice/Data/certs + cp onlyoffice.key /var/www/onlyoffice/Data/certs/ + cp onlyoffice.crt /var/www/onlyoffice/Data/certs/ + chmod 400 /var/www/onlyoffice/Data/certs/onlyoffice.key + /app/ds/run-document-server.sh" + timeout 150 bash -c 'until curl -kfsSL https://localhost:7443/hosting/discovery > /dev/null; do sleep 5; done' + echo "onlyoffice ready." + + #Start FakeOffice + docker run -d --name fakeoffice --network host \ + -v "$(pwd):/ocis:ro" \ + python:3-alpine \ + python3 -c " + import http.server, pathlib + body = pathlib.Path('/ocis/tests/config/ci/hosting-discovery.xml').read_bytes() + class H(http.server.BaseHTTPRequestHandler): + def do_GET(self): + self.send_response(200) + self.send_header('Content-Type', 'text/xml') + self.end_headers() + self.wfile.write(body) + def log_message(self, *a): pass + http.server.HTTPServer(('', 8080), H).serve_forever() + " + timeout 60 bash -c 'until curl -fsSL http://localhost:8080/hosting/discovery > /dev/null; do sleep 5; done' + echo "fakeoffice ready." + + bash tests/config/k8s/expose-external-svc.sh collabora:9980 + bash tests/config/k8s/expose-external-svc.sh onlyoffice:7443 + bash tests/config/k8s/expose-external-svc.sh fakeoffice:8080 + fi + - name: Deploy oCIS run: | cd tests/config/k8s kubectl get pods -n "$TEST_SERVER_DOMAIN" -Aw & make deploy-ocis + - name: Expose node ports + if: ${{ matrix.suite == 'app-provider' }} + run: | + bash tests/config/k8s/expose-nodeports.sh collaboration-collabora 9300 30300 + bash tests/config/k8s/expose-nodeports.sh collaboration-fakeoffice 9300 30301 + bash tests/config/k8s/expose-nodeports.sh collaboration-onlyoffice 9300 30302 + bash tests/config/k8s/expose-nodeports.sh collaboration-fakeoffice 9304 30304 + - name: Wait for oCIS to be ready env: FILE_URL: ${{ env.TEST_SERVER_URL }}/remote.php/dav/files/admin/hello1.txt @@ -618,6 +688,7 @@ jobs: E2E_ARGS: "${{ matrix.args }}" K8S: ${{ env.K8S }} TEST_SERVER_URL: ${{ env.TEST_SERVER_URL }} + COLLABORATION_NEEDED: ${{ matrix.collaboration == true && 'true' || 'false' }} run: python3 tests/acceptance/run-e2e.py - name: Upload Playwright traces diff --git a/tests/config/k8s/setup.sh b/tests/config/k8s/setup.sh index b5a8c8f5160..128687b0502 100644 --- a/tests/config/k8s/setup.sh +++ b/tests/config/k8s/setup.sh @@ -74,6 +74,7 @@ if [[ "$ENABLE_WOPI" == "true" ]]; then -e 's/{{- include "ocis.extraVolMounts" \. | nindent 12 }}/{{- include "ocis.extraVolMounts" $ | nindent 12 }}/' \ -e 's/{{- include "ocis.extraVolumes" \. | nindent 8 }}/{{- include "ocis.extraVolumes" $ | nindent 8 }}/' \ $TPL_DIR/collaboration/deployment.yaml + sed -i "s|availableUnifiedRoles: \[\]|availableUnifiedRoles: ['b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5','a8d5fe5e-96e3-418d-825b-534dbdf22b99','fb6c3e19-e378-47e5-b277-9732f9de6e21','58c63c02-1d89-4572-916a-870abc5a1b7d','2d00ce52-1fc2-4dbc-8b95-a73b73395f5a','1c996275-f1c9-4e71-abdf-a42f6495e960','312c0871-5ef7-4b3a-85b6-0e4074c64049','aa97fe03-7980-45ac-9e50-b325749fd7e6']|" $CFG_DIR/values.yaml fi if [[ "$ENABLE_OCM" == "true" ]]; then diff --git a/tests/config/k8s/values.yaml b/tests/config/k8s/values.yaml index c7fa54254af..da20ccad04d 100644 --- a/tests/config/k8s/values.yaml +++ b/tests/config/k8s/values.yaml @@ -51,21 +51,45 @@ features: max: '0' appsIntegration: enabled: false + mimetypes: + - mime_type: application/vnd.oasis.opendocument.text + extension: odt + name: OpenDocument + description: OpenDocument text document + icon: "" + default_app: Collabora + allow_creation: true + - mime_type: application/vnd.openxmlformats-officedocument.wordprocessingml.document + extension: docx + name: Microsoft Word + description: Microsoft Word document + icon: "" + default_app: OnlyOffice + allow_creation: true + - mime_type: text/plain + extension: txt + name: Plain text + description: Plain text file + icon: "" + default_app: FakeOffice + allow_creation: true wopiIntegration: officeSuites: - name: 'Collabora' uri: 'https://collabora:9980' + iconURI: 'https://collabora:9980/favicon.ico' wopiSrc: 'http://ocis-server:9300' product: 'Collabora' enabled: true insecure: true disableProof: true - secureViewEnabled: false + secureViewEnabled: true disableChat: true ingress: enabled: false - name: 'FakeOffice' uri: 'http://fakeoffice:8080' + iconURI: 'http://fakeoffice:8080/favicon.ico' wopiSrc: 'http://ocis-server:9301' product: 'FakeOffice' enabled: true @@ -77,6 +101,7 @@ features: enabled: false - name: 'OnlyOffice' uri: 'https://onlyoffice:7443' + iconURI: 'https://onlyoffice:7443/web-apps/apps/documenteditor/main/resources/img/favicon.ico' wopiSrc: 'http://ocis-server:9302' product: 'OnlyOffice' enabled: true @@ -86,6 +111,8 @@ features: disableChat: true ingress: enabled: false + roles: + availableUnifiedRoles: [] http: cors: