Skip to content
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

Conversation

daniel-heppner-ibigroup
Copy link
Contributor

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.

this change alters the test so that they test the full integration including the “calculateFares” method rather than just the “populateFares” method
@daniel-heppner-ibigroup daniel-heppner-ibigroup requested a review from a team as a code owner October 12, 2023 23:27
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (83c4584) 66.57% compared to head (1e09af2) 66.58%.
Report is 13 commits behind head on dev-2.x.

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     
Files Coverage Δ
...tripplanner/ext/fares/impl/DefaultFareService.java 92.23% <100.00%> (+0.03%) ⬆️
...pentripplanner/ext/fares/impl/OrcaFareService.java 74.64% <100.00%> (+0.09%) ⬆️

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leonardehrenfried leonardehrenfried added Bug Sandbox IBI Developed by or important for IBI Group Skip Changelog labels Oct 13, 2023
@leonardehrenfried leonardehrenfried changed the title Fix orca cross agency fares Fix ORCA cross-agency fares Oct 13, 2023
assertEquals(expectedPrice, fare.getFare(fareType));
var itinerary = new Itinerary(legs);
var itineraryFares = orcaFareService.calculateFares(itinerary);
assertEquals(expectedPrice, itineraryFares.getFare(fareType));
Copy link
Member

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.

Copy link
Contributor Author

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.

@leonardehrenfried leonardehrenfried force-pushed the fix-orca-cross-agency-fares branch from 790cf3f to 1e09af2 Compare October 13, 2023 07:52
@leonardehrenfried leonardehrenfried merged commit dcc4037 into opentripplanner:dev-2.x Oct 13, 2023
@leonardehrenfried leonardehrenfried deleted the fix-orca-cross-agency-fares branch October 13, 2023 08:06
@t2gran t2gran added this to the 2.5 (next release) milestone Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IBI Developed by or important for IBI Group Sandbox Skip Changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants