Closed leonardehrenfried closed 1 month ago
Attention: Patch coverage is 92.85714%
with 4 lines
in your changes are missing coverage. Please review.
Project coverage is 68.49%. Comparing base (
8f632f1
) to head (2d86fc6
). Report is 1 commits behind head on dev-2.x.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've now rebased onto dev-2.x which contains @habrahamsson-skanetrafiken's Siri tests and they all still pass.
Summary
We discussed in one of the realtime meetings that the GTFS-RT and Siri code needs to be unified. This PR makes one step into that direction by introducing an abstract base class for handling the timetable snaphots. This is then used by both the Siri and GTFS-RT updaters.
Previously their handling of the snapshot was very similar, but not identical: Siri would always initialise a snapshot in the constructor but GTFS-RT would not. This meant that I had to modify the tests ever so slightly to make them pass, reflecting the fact that GTFS-RT now also initialises a snapshot during instantiation.
Further work
While using a base class has improved encapsulation and the separation of input mapping code from "framework code" (many fields are now private to the base class), the buffer is still very much exposed. In further work I would like to improve this further by totally encapsulating the buffer.
In the end I see design like the following:
Unit tests
Unit tests were updated. Slight modifications were necessary.
Other work
5852 and #5726 also touch on very similar code and I will wait until they are merged before requesting a code review.