test: add federation integration tests (Behat, two-instance)#393
Open
miaulalala wants to merge 4 commits into
Open
test: add federation integration tests (Behat, two-instance)#393miaulalala wants to merge 4 commits into
miaulalala wants to merge 4 commits into
Conversation
Sets up the same two-PHP-server pattern used by Deck (PR #7734) and Spreed: - run-federation.sh: creates a second NC instance under data/, configures both, starts two PHP built-in servers on :8080/:8280, runs Behat, then tears down - FederationContext.php: OCS/Basic-Auth context with steps for server switching, user creation via occ, project creation, federated share/accept/reject/remove, pending-invitation polling with retry, and settings toggle helpers - sharing.feature: send invite → pending invite appears → accept → project visible; also tests rejection path - unshare.feature: host removes accepted share → remote loses access; host removes pending (never-accepted) share - settings.feature: outgoing disabled blocks share creation (400); incoming disabled on remote causes OCM share to be refused (400) - integration-federation.yml: GitHub Actions workflow (PHP 8.3, NC master, SQLite) mirroring the Deck federation CI workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PHPUnit\Framework\Assert was not found at runtime because phpunit was missing from tests/integration/composer.json. Add it, and add a .gitignore so the generated composer.lock and vendor/ are not tracked (matching the pattern used by nextcloud/deck). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The PHP built-in web server returns 404 for virtual paths like /.well-known/ocm and /ocm-provider, which breaks OCM discovery when LOCAL tries to send a federated share to REMOTE. Add router.php that routes virtual paths through index.php while correctly forwarding real files and PATH_INFO paths (like /ocs/v2.php/apps/...) to PHP's default handling. Also add overwrite.cli.url on both instances so Nextcloud knows its public URL when generating OCM share callbacks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Nextcloud's getRawPathInfo() uses SCRIPT_NAME to strip the script path from REQUEST_URI. When the router script includes index.php without overriding SCRIPT_NAME, getRawPathInfo() throws because the router.php path doesn't match the request URI. Set SCRIPT_NAME=/index.php before including index.php so Nextcloud computes the path info correctly for well-known requests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets up the same two-PHP-server pattern used by Deck (PR #7734) and Spreed:
run-federation.sh: creates a second NC instance under data/, configures both, starts two PHP built-in servers on :8080/:8280, runs Behat, then tears down
FederationContext.php: OCS/Basic-Auth context with steps for server switching, user creation via occ, project creation, federated share/accept/reject/remove, pending-invitation polling with retry, and settings toggle helpers
sharing.feature: send invite → pending invite appears → accept → project visible; also tests rejection path
unshare.feature: host removes accepted share → remote loses access; host removes pending (never-accepted) share
settings.feature: outgoing disabled blocks share creation (400); incoming disabled on remote causes OCM share to be refused (400)
integration-federation.yml: GitHub Actions workflow (PHP 8.3, NC master, SQLite) mirroring the Deck federation CI workflow
This PR was partly or wholly created by AI