-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ORCA cross-agency fares #5426
Fix ORCA cross-agency fares #5426
Conversation
this change alters the test so that they test the full integration including the “calculateFares” method rather than just the “populateFares” method
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5426 +/- ##
==========================================
Coverage 66.57% 66.58%
- Complexity 15310 15317 +7
==========================================
Files 1792 1792
Lines 69522 69538 +16
Branches 7330 7333 +3
==========================================
+ Hits 46284 46299 +15
Misses 20756 20756
- Partials 2482 2483 +1
☔ View full report in Codecov by Sentry. |
assertEquals(expectedPrice, fare.getFare(fareType)); | ||
var itinerary = new Itinerary(legs); | ||
var itineraryFares = orcaFareService.calculateFares(itinerary); | ||
assertEquals(expectedPrice, itineraryFares.getFare(fareType)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a future round of development we probably want to be more specific in our assertions and making sure that the fares are correctly assigned to the individual legs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a test that checks the leg information is correct, but you're right that eventually all the tests should be checking each leg.
790cf3f
to
1e09af2
Compare
Summary
The recent changes to fares which grouped legs by their feed ID broke the ORCA fare module's ability to calculate transfers between different agencies. This PR changes the ORCA fare module tests to also test the complexity contained in the super class. Then, it moves the feed grouping logic into an overrideable method which the ORCA module overrides to group all the legs together.
Unit tests
The tests are updated and improved to ensure that this bug would be caught in the future, and then they are used to correct the bug. The results have been double checked by testing some trip plans.