OpenRailAssociation / osrd

An open source web application for railway infrastructure design, capacity analysis, timetabling and simulation
https://osrd.fr
GNU Lesser General Public License v3.0
419 stars 40 forks source link

editoast: train-simulation: return SimulationFailed on 500 from core #7971

Closed Castavo closed 3 days ago

Castavo commented 1 week ago

When core.fetch returns an Error made from a 500 from core, train_simulation returns Ok(SimulationResponse::SimulationFailed) rather than an Error.

This allows to still be able to call train_schedule/simulation_summary when one of the trains leads to an error in core (an assert error for example).

I left other error status codes fail because they'll likely be transient, what do you think ?

codecov-commenter commented 1 week ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 28.27%. Comparing base (b05d26f) to head (1848027).

Files Patch % Lines
editoast/src/views/v2/train_schedule.rs 0.00% 6 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #7971 +/- ## ============================================ - Coverage 28.28% 28.27% -0.01% Complexity 2075 2075 ============================================ Files 1273 1273 Lines 156082 156087 +5 Branches 3081 3081 ============================================ - Hits 44149 44136 -13 - Misses 110095 110113 +18 Partials 1838 1838 ``` | [Flag](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7971/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [core](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7971/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `75.03% <ø> (ø)` | | | [editoast](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7971/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `70.96% <0.00%> (-0.06%)` | :arrow_down: | | [front](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7971/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `9.93% <ø> (ø)` | | | [gateway](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7971/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `2.34% <ø> (ø)` | | | [railjson_generator](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7971/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `87.49% <ø> (ø)` | | | [tests](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7971/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `72.93% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Castavo commented 3 days ago

Would not work since 500 errors could come from core but also from diesel for example...