Skip to content

Refactor and group validation writer tests data - #4312

Open
samirromdhani wants to merge 9 commits into
loadflow-validation-reworkfrom
refactor/loadflow_validation-formatter-tests
Open

samirromdhani wants to merge 9 commits into
loadflow-validation-reworkfrom
refactor/loadflow_validation-formatter-tests

Conversation

@samirromdhani

@samirromdhani samirromdhani commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added
  • Docs have been added / updated (on the readthedocs)
  • Code comments (Javadoc, docstring, ...) have been added/updated
  • There is no need to update the code comments or the readthedocs
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

What kind of change does this PR introduce?

What is the current behavior?

Formatter writer tests share many generic fields (p, q, v, connected, mainComponent...) between elements
A wrong or shared value can go undetected, this is already the case for

  • SVC: vControlled and vController both used v. Each one now reads its own value.
  • 3W transformer: mainComponent2 and mainComponent3 used the wrong constant. (fixed)

What is the new behavior (if this is a feature change)?
Test data is grouped by element. The written output is unchanged.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

@samirromdhani samirromdhani changed the title Group test data Refactor and group validation formatter writer tests data Dec 3, 2026
@samirromdhani
samirromdhani force-pushed the refactor/loadflow_validation-formatter-tests branch from be61c4a to 6406f2e Compare December 3, 2026 10:58
@samirromdhani samirromdhani changed the title Refactor and group validation formatter writer tests data Refactor and group validation writer tests data Dec 3, 2026
@samirromdhani
samirromdhani force-pushed the refactor/loadflow_validation-formatter-tests branch from 6406f2e to cb5a3e5 Compare December 3, 2026 13:12
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
@samirromdhani
samirromdhani force-pushed the refactor/loadflow_validation-formatter-tests branch from cb5a3e5 to 3b8d746 Compare December 3, 2026 13:34
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
@samirromdhani
samirromdhani force-pushed the refactor/loadflow_validation-formatter-tests branch from 0e85e9c to 073b59d Compare December 4, 2026 13:54
Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
String.join(";", svcId, "p", String.format(Locale.getDefault(), "%g", -p)),
String.join(";", svcId, "q", String.format(Locale.getDefault(), "%g", -q)),
String.join(";", svcId, "vControlled", String.format(Locale.getDefault(), "%g", v)),
String.join(";", svcId, "vController", String.format(Locale.getDefault(), "%g", v)),

@samirromdhani samirromdhani Dec 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: both (vControlled) and (vController) used v

…n component in twt3w

Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
@samirromdhani
samirromdhani force-pushed the refactor/loadflow_validation-formatter-tests branch from 2bd69c0 to 9574ea9 Compare December 4, 2026 15:57
String.format(Locale.getDefault(), "%g", TwtTestData.RATED_U0),
Boolean.toString(TwtTestData.CONNECTED1),
Boolean.toString(TwtTestData.CONNECTED2), Boolean.toString(TwtTestData.CONNECTED3), Boolean.toString(TwtTestData.MAIN_COMPONENT1),
Boolean.toString(TwtTestData.MAIN_COMPONENT2), Boolean.toString(TwtTestData.MAIN_COMPONENT2), AbstractValidationFormatterWriter.SUCCESS));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: mainComponent3 used MAIN_COMPONENT2.

String.join(";", twt3wId, AbstractValidationFormatterWriter.CONNECTED + "3", Boolean.toString(TwtTestData.CONNECTED3)),
String.join(";", twt3wId, AbstractValidationFormatterWriter.MAIN_COMPONENT + "1", Boolean.toString(TwtTestData.MAIN_COMPONENT1)),
String.join(";", twt3wId, AbstractValidationFormatterWriter.MAIN_COMPONENT + "2", Boolean.toString(TwtTestData.MAIN_COMPONENT1)),
String.join(";", twt3wId, AbstractValidationFormatterWriter.MAIN_COMPONENT + "3", Boolean.toString(TwtTestData.MAIN_COMPONENT1)),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed : mainComponent2 and mainComponent3 used MAIN_COMPONENT1.

Signed-off-by: Samir Romdhani <samir.romdhani_externe@rte-france.com>
@samirromdhani
samirromdhani force-pushed the refactor/loadflow_validation-formatter-tests branch from 744d876 to 038f14c Compare December 4, 2026 16:14
@samirromdhani
samirromdhani marked this pull request as ready for review December 4, 2026 16:15
@samirromdhani samirromdhani self-assigned this Dec 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant