From 2e5bf89a3adfdd4939ccd74fefd6f528d4f1fdaf Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 4 May 2026 09:05:35 -0400 Subject: [PATCH 1/6] test(integration): add built-in/richdocumentscode Signed-off-by: Josh --- tests/run-integration.sh | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/tests/run-integration.sh b/tests/run-integration.sh index d04e46bc75..12c9f5bf99 100755 --- a/tests/run-integration.sh +++ b/tests/run-integration.sh @@ -14,6 +14,16 @@ PORT_SERVERA=8080 PORT_SERVERB=8081 PORT_COOL=9980 +# Backend mode for the Collabora integration: +# - external: use a standalone CODE/Collabora container (default) +# - embedded: use richdocumentscode proxy.php flow +CODE_PROVIDER=${CODE_PROVIDER:-external} + +# Default WOPI endpoint for the external Collabora container. +# For the embedded richdocumentscode path, the workflow should set: +# WOPI_URL=http://localhost/apps/richdocumentscode/proxy.php?req= +WOPI_URL=${WOPI_URL:-http://localhost:$PORT_COOL} + INSTALLED=$($OCC status | grep installed: | cut -d " " -f 5) if [ "$INSTALLED" == "true" ]; then @@ -28,29 +38,29 @@ fi composer install composer dump-autoload -if curl --fail http://localhost:$PORT_COOL/hosting/capabilities; then - echo "Collabora server already running at port $PORT_COOL" +if [ "$CODE_PROVIDER" = "embedded" ]; then + echo "Using embedded Collabora (richdocumentscode) via $WOPI_URL" else - if ! docker info >/dev/null 2>&1; then - echo "Docker does not seem to be running, so start the docker daemon or run a collabora server manually" - exit 1 + if curl --fail "$WOPI_URL/hosting/capabilities"; then + echo "Collabora server already running at port $PORT_COOL" + else + if ! docker info >/dev/null 2>&1; then + echo "Docker does not seem to be running, so start the docker daemon or run a collabora server manually" + exit 1 + fi + COOL_CONTAINER=$(docker run -t -d -p 9980:9980 -e "domain=localhost" -e "extra_params=--o:ssl.enable=false" collabora/code) fi - COOL_CONTAINER=$(docker run -t -d -p 9980:9980 -e "domain=localhost" -e "extra_params=--o:ssl.enable=false" collabora/code) -fi; - -curl --fail http://localhost:$PORT_COOL/hosting/capabilities - +fi +curl --fail "$WOPI_URL/hosting/capabilities" PHP_CLI_SERVER_WORKERS=10 php -S localhost:$PORT_SERVERA -t $OC_PATH & PHPPIDA=$! PHP_CLI_SERVER_WORKERS=10 php -S localhost:$PORT_SERVERB -t $OC_PATH & PHPPIDB=$! +$OCC richdocuments:setup --wopi_url="$WOPI_URL" -$OCC config:app:set richdocuments wopi_url --value="http://localhost:9980" -$OCC config:app:set richdocuments public_wopi_url --value="http://localhost:9980" -$OCC richdocuments:activate-config $OCC config:system:set allow_local_remote_servers --value true --type bool $OCC config:system:set gs.trustedHosts 0 --value="localhost:$PORT_SERVERA" $OCC config:system:set gs.trustedHosts 1 --value="localhost:$PORT_SERVERB" @@ -61,7 +71,7 @@ RESULT=$? kill $PHPPIDA kill $PHPPIDB -[[ -v COOL_CONTAINER ]] && docker stop $container_id +[[ -v COOL_CONTAINER ]] && docker stop "$COOL_CONTAINER" echo "runsh: Exit code: $RESULT" exit $RESULT From 8bf5574184bcaea3d7250e7c25da163bc64876f0 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 4 May 2026 09:12:43 -0400 Subject: [PATCH 2/6] test(integration): add richdocumentscode to GH workflow Signed-off-by: Josh --- .github/workflows/integration.yml | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0d8a7528dd..6da121d655 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -349,6 +349,68 @@ jobs: working-directory: apps/${{ env.APP_NAME }} run: cd tests && bash run-integration.sh features/${{ matrix.scenarios }}.feature + richdocumentscode: + runs-on: ubuntu-latest + + needs: changes + if: needs.changes.outputs.src != 'false' + + strategy: + fail-fast: false + matrix: + php-versions: ['8.2'] + databases: ['sqlite'] + server-versions: ['master'] + scenarios: ['setup_features/richdocumentscode'] + + name: integration-${{ matrix.scenarios }}-${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} + + steps: + - name: Checkout server + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + submodules: true + + - name: Checkout app + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + path: apps/${{ env.APP_NAME }} + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2.36.0 + with: + php-version: ${{ matrix.php-versions }} + tools: phpunit:8.5.14 + extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, gd, zip, apcu + ini-values: + apc.enable_cli=on + coverage: none + + - name: Set up PHPUnit + working-directory: apps/${{ env.APP_NAME }} + run: composer install --no-dev + + - name: Set up Nextcloud + env: + DB_PORT: 4444 + run: | + mkdir data + echo '"\OC\Memcache\APCu","hashing_default_password"=>true];' > config/config.php + ./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin + ./occ app:enable --force --force ${{ env.APP_NAME }} + ./occ app:enable --force richdocumentscode + + - name: Run richdocumentscode integration tests + working-directory: apps/${{ env.APP_NAME }} + env: + CODE_PROVIDER: embedded + WOPI_URL: http://localhost/apps/richdocumentscode/proxy.php?req= + run: cd tests && bash run-integration.sh features/setup_features/richdocumentscode.feature + summary: permissions: contents: none From 3d3b93016c636540212f87a5435b3019dc17b3db Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 4 May 2026 09:24:33 -0400 Subject: [PATCH 3/6] chore(integration): simplify richdocumentscode workflow Signed-off-by: Josh --- .github/workflows/integration.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 6da121d655..b10f84f857 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -361,7 +361,7 @@ jobs: php-versions: ['8.2'] databases: ['sqlite'] server-versions: ['master'] - scenarios: ['setup_features/richdocumentscode'] + scenarios: ['wopi', 'direct', 'federation', 'api', 'secure-view', 'admin-settings'] name: integration-${{ matrix.scenarios }}-${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} @@ -404,13 +404,13 @@ jobs: ./occ app:enable --force --force ${{ env.APP_NAME }} ./occ app:enable --force richdocumentscode - - name: Run richdocumentscode integration tests + - name: Run ${{ matrix.scenarios }} integration tests working-directory: apps/${{ env.APP_NAME }} env: CODE_PROVIDER: embedded WOPI_URL: http://localhost/apps/richdocumentscode/proxy.php?req= - run: cd tests && bash run-integration.sh features/setup_features/richdocumentscode.feature - + run: cd tests && bash run-integration.sh features/${{ matrix.scenarios }}.feature + summary: permissions: contents: none From f03ba08ecda7c502b2afa4d91b7bcfafbdd687db Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 4 May 2026 09:28:37 -0400 Subject: [PATCH 4/6] Update run-integration.sh Signed-off-by: Josh --- tests/run-integration.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/run-integration.sh b/tests/run-integration.sh index 12c9f5bf99..18e2776a5d 100755 --- a/tests/run-integration.sh +++ b/tests/run-integration.sh @@ -40,6 +40,7 @@ composer dump-autoload if [ "$CODE_PROVIDER" = "embedded" ]; then echo "Using embedded Collabora (richdocumentscode) via $WOPI_URL" + sleep 10 else if curl --fail "$WOPI_URL/hosting/capabilities"; then echo "Collabora server already running at port $PORT_COOL" From 8dd5c7eb9dae31e79c02f404f21d2c95d5976686 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 4 May 2026 09:38:30 -0400 Subject: [PATCH 5/6] test(integration): give RDC time to start Signed-off-by: Josh --- .github/workflows/integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b10f84f857..761acc944f 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -403,6 +403,7 @@ jobs: ./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin ./occ app:enable --force --force ${{ env.APP_NAME }} ./occ app:enable --force richdocumentscode + sleep 10 - name: Run ${{ matrix.scenarios }} integration tests working-directory: apps/${{ env.APP_NAME }} From bfa7e5af325a85ca6602f8f4136542eca1bae5f7 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 4 May 2026 09:39:27 -0400 Subject: [PATCH 6/6] test(integration): fixup wopi-url syntax Signed-off-by: Josh --- tests/run-integration.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run-integration.sh b/tests/run-integration.sh index 18e2776a5d..741af5ec68 100755 --- a/tests/run-integration.sh +++ b/tests/run-integration.sh @@ -40,7 +40,7 @@ composer dump-autoload if [ "$CODE_PROVIDER" = "embedded" ]; then echo "Using embedded Collabora (richdocumentscode) via $WOPI_URL" - sleep 10 + sleep 20 else if curl --fail "$WOPI_URL/hosting/capabilities"; then echo "Collabora server already running at port $PORT_COOL" @@ -60,7 +60,7 @@ PHPPIDA=$! PHP_CLI_SERVER_WORKERS=10 php -S localhost:$PORT_SERVERB -t $OC_PATH & PHPPIDB=$! -$OCC richdocuments:setup --wopi_url="$WOPI_URL" +$OCC richdocuments:setup --wopi-url="$WOPI_URL" $OCC config:system:set allow_local_remote_servers --value true --type bool $OCC config:system:set gs.trustedHosts 0 --value="localhost:$PORT_SERVERA"