test(app): studysets synced against a running server
The first tests that need serverpod start running (ADR 0001, rule 9: the client's and the server's sync engines can't share one process), tagged requires-server: tool/check.sh skips them, flutter test -t requires-server runs them. Every device is its own client and local database with the app's real gateway and repository, and syncs only when a test says so. They state: two devices of one person end up with the same studysets; a deleted studyset leaves the other devices, and its payload is blank on the server, checked with SQL against the development database because the engine keeps deleted rows; a studyset written into another person's space never reaches them; claiming another person's space shows none of their studysets, since the server sends only the spaces the signed-in person has access to. As written here, the forgery test also expects the server to refuse and log the write, and the SQL checks connect over TCP; the first run against the server corrected both (see the commit "the sync tests pass against the running server"). They live in the app package: the server's Docker build resolves its dependencies with only the server package present, so a dev dependency on the client package would break it. They never initialize a Flutter test binding, which would replace real HTTP with a mock. Without a server they fail at sign-in with "connection refused". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
5d6680dc5b
commit
ba55d6f725
1 changed files with 272 additions and 1 deletions
|
|
@ -51,6 +51,10 @@ dev_dependencies:
|
|||
sdk: flutter
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
# The sync tests (test/sync/) sign in like the app and read the server's database.
|
||||
postgres: ^3.5.16
|
||||
serverpod_auth_core_client: 4.0.3
|
||||
yaml: ^3.1.4
|
||||
|
||||
dependency_overrides:
|
||||
flutter_secure_storage: ^10.0.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue