Repository navigation
Tests against a real PostgreSQL, specs for the untested views and map layers, and a compact trip format for the map - #522
Merged
Conversation
Most backend tests use EF's in-memory database, which has no indexes, transactions, concurrency tokens or bulk updates, so what only PostgreSQL decides went untested. GarageStack.Tests/Postgres runs it against a real server: every migration from an empty database (and back three and forward), the unique trip index and its transaction, hidden trips and joins in SQL, the partial telemetry UPDATE and NOTIFY, the model-derived filters behind the merged status and the daily statistics, concurrent settings saves, the climate schedule version token, and the bulk deletes and updates of housekeeping and notifications. Each test gets a database copied from a template migrated once per run. The server comes from GARAGESTACK_TEST_POSTGRES; without it the tests skip locally and fail in CI, whose backend job now runs a postgres:18 service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6DtW2eHhipteRopmy3cif
…ws and the map layers Specs for the four views that had none (what each loads, when it loads again, its empty and error states, hiding and joining trips) and for useTripLayers and usePoiLayers, with Leaflet and the tile layers replaced by recorders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6DtW2eHhipteRopmy3cif
joszz
enabled auto-merge
October 19, 2026 20:43
Under a full test run the active pinia was sometimes another one by the time a test read its store, so the dashboard spec saw no reload after a trip ended about one run in four. Each mount now gets the test's pinia as a plugin, and every store the test reads names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6DtW2eHhipteRopmy3cif
GET .../trips?format=compact serves the same trips with their fixes as an encoded polyline (six decimals), the milliseconds from each fix to the next and the speeds: a month of driving is about half the download. The map asks for it and unpacks it in vehicleApi.trips, so nothing past the client changes. The plain format stays the default, for scripts reading it with an API token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6DtW2eHhipteRopmy3cif
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.
Pull Request
Summary
P5 from the project review (the gaps in the tests), and #15 from P2 (the map's trip download).
ExecuteUpdate/ExecuteDelete, the SQL the trip, telemetry, settings, climate schedule, housekeeping and notification queries become, and NOTIFY. Each test gets a copy of a template the migrations build once per run, dropped afterwards. They needGARAGESTACK_TEST_POSTGRES: without it they skip locally and fail in CI (CI=true), so they cannot pass there by not running. Thebackend-testjob now starts apostgres:18-alpineservice for them. CONTRIBUTING.md and ARCHITECTURE.md say how to run them.GET .../trips?format=compact(CompactTripDto) serves the same trips with their fixes as an encoded polyline at six decimals (PolylineCodec, about 10 cm), the milliseconds from each fix to the next, and the speeds. On a synthetic month of driving (6,000 fixes) that is 39 KB gzipped instead of 82 KB. The intervals are taken between rounded offsets from the start, so every fix's time stays within half a millisecond however long the trip. The map asks for it andvehicleApi.tripsunpacks it into the plainTripshape, so nothing past the client changes. The plain format stays the default, so scripts reading/tripswith an API token are not affected; any otherformatvalue is a 400trip.unknownFormat.Type of Change
Related Issues
Follows #521.
Checklist
TripDtoTestsandvehicleApi.spec.tsagainst an independently encoded polyline, and compared fix by fix with the plain format through the demo stack)dotnet format --verify-no-changes; 1478 backend tests (PostgreSQL ones included) and 1197 frontend tests locallyunraid/garagestack.xmlchanged: not changedThe PostgreSQL service in CI is new: this PR's run is its first. Not checked here: the map against the compact format in a browser (the client unpacks into the same shape the map already draws).
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6DtW2eHhipteRopmy3cif