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

tests: add (xfail) ETCS braking curve integration test #10294

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

bougue-pe
Copy link
Contributor

  • Added the final stop to get a final braking curve.
  • ETCS is not available, so unplugged it to avoid crash (fallback to const gamma).
  • So tests added are wrong and must break/be modified when plugging ETCS.

To be merged once #10147
Fixes part of #9706

@bougue-pe bougue-pe requested a review from Erashin January 9, 2025 08:54
@bougue-pe bougue-pe requested review from a team as code owners January 9, 2025 08:54
@bougue-pe bougue-pe requested review from shenriotpro and removed request for a team January 9, 2025 08:54
@github-actions github-actions bot added area:core Work on Core Service area:integration-tests Work on Integration test, by nature related to different services labels Jan 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

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

Codecov Report

Attention: Patch coverage is 95.55556% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.56%. Comparing base (c806a2f) to head (53afcc1).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
tests/conftest.py 96.00% 1 Missing ⚠️
tests/fuzzer/fuzzer.py 0.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10294      +/-   ##
==========================================
- Coverage   81.58%   81.56%   -0.02%     
==========================================
  Files        1062     1062              
  Lines      104970   105009      +39     
  Branches      722      722              
==========================================
+ Hits        85636    85655      +19     
- Misses      19293    19313      +20     
  Partials       41       41              
Flag Coverage Δ
editoast 73.63% <ø> (-0.07%) ⬇️
front 89.30% <ø> (ø)
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 87.62% <95.55%> (+0.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Base automatically changed from peb/editoast/add_etcs_brake_params_to_rs_model to dev January 9, 2025 09:49
@github-actions github-actions bot requested review from a team as code owners January 9, 2025 09:49
@@ -37,6 +37,13 @@ def small_infra() -> Iterator[Infra]:
requests.delete(EDITOAST_URL + f"infra/{infra_id}/")


@pytest.fixture(scope="session")
def etcs_infra() -> Iterator[Infra]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how small is it? :p

@@ -115,9 +132,9 @@ class TestRollingStock:
TestRollingStock.__test__ = False


def create_fast_rolling_stocks(test_rolling_stocks: Optional[List[TestRollingStock]] = None):
def create_rolling_stock(rolling_stock_json_path: Path, test_rolling_stocks: Optional[List[TestRollingStock]] = None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we add a return type?

@@ -187,6 +213,7 @@ def west_to_south_east_simulation(
{"offset": 837034, "track": "TA2", "id": "a"},
{"offset": 4386000, "track": "TH1", "id": "b"},
],
"schedule": [{"at": "b", "stop_for": "PT0S"}],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a description of the new infra/rs somewhere?

tests/conftest.py Show resolved Hide resolved
assert get_current_or_next_speed_at(simulation_final_output, final_stop_const_brake_start_offset + 1) < 39.444


def get_current_or_next_speed_at(simulation_final_output: Dict[str, Any], position: int) -> int:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if we don't want to export it, let's call it _get_current_or_next_speed_at

* Added the final stop to get a final braking curve.
* ETCS is not available, so unplugged it to avoid crash (fallback to
  const gamma).
* So tests added are wrong and must break/be modified when plugging ETCS.

Signed-off-by: Pierre-Etienne Bougué <[email protected]>
@bougue-pe bougue-pe force-pushed the peb/tests/add_etcs_integration_tests branch from 3e87ad4 to 53afcc1 Compare January 9, 2025 10:53
@bougue-pe bougue-pe requested review from a team and bloussou and removed request for a team and bloussou January 9, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core Work on Core Service area:integration-tests Work on Integration test, by nature related to different services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants