test: verify Protocol v1 against the real server - #4
Merged
Merged
Conversation
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.
Summary
Add a cross-repository compatibility test that runs the real Usage Statistics PHP client against a real Nextcloud instance with
usage_statistics_serverenabled.The scenario:
Reportusing the public client APIClientWhy
Unit tests in the client and integration tests in the server can both stay green while their wire contracts diverge. The initial server implementation exposed only an OCS response envelope while the generic client expects the Protocol v1 response body directly.
LibreCodeCoop/usage_statistics_server#23 now exposes both a plain Protocol v1 JSON route and an OCS route backed by the same submission logic. This compatibility test deliberately exercises the plain route so the PHP client remains framework-agnostic.
Transport in this test
The production client keeps its HTTPS-only
Endpointvalidation. The Behat environment uses a test-onlyTransportInterfaceadapter that maps the logical HTTPS endpoint to the local Nextcloud HTTP server.This exercises the real report objects, serialization, consent gate, protocol response handling, server validation, persistence and aggregation without weakening production endpoint safety.
Compatibility target
LibreCodeCoop/usage_statistics_server#23 is merged. The compatibility workflow now tests against
usage_statistics_server/main.