Skip to content

test: verify Protocol v1 against the real server - #4

Merged
vitormattos merged 14 commits into
mainfrom
test/server-protocol-e2e
Sep 30, 2026
Merged

vitormattos merged 14 commits into
mainfrom
test/server-protocol-e2e

Conversation

@vitormattos

@vitormattos vitormattos commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Add a cross-repository compatibility test that runs the real Usage Statistics PHP client against a real Nextcloud instance with usage_statistics_server enabled.

The scenario:

  • registers a generic application schema on the server
  • creates a Protocol v1 Report using the public client API
  • submits it through the real Client
  • queries the server aggregation API
  • verifies that the exact categorical and numerical values were stored and aggregated

Why

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 Endpoint validation. The Behat environment uses a test-only TransportInterface adapter 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.

@vitormattos
vitormattos marked this pull request as ready for review September 30, 2026 18:45
@vitormattos
vitormattos merged commit 39d6152 into main Sep 30, 2026
14 of 15 checks passed
@vitormattos
vitormattos deleted the test/server-protocol-e2e branch September 30, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant