Skip to content

Commit

Permalink
add cucumber tests
Browse files Browse the repository at this point in the history
Signed-off-by: belthlemar <[email protected]>
  • Loading branch information
MartinBelthle committed Mar 25, 2024
1 parent 28291b5 commit 16c3760
Show file tree
Hide file tree
Showing 13 changed files with 1,992 additions and 39 deletions.
20 changes: 9 additions & 11 deletions tests/src/test/resources/features/epic13_curative/US13_5.feature
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,17 @@ Feature: US 13.5: dynamic of range actions available in several instants
Given configuration file is "epic13/RaoParameters_maxMargin_ampere_2p.json"
When I launch search_tree_rao at "2019-01-08 12:00"
Then 2 remedial actions are used in preventive
And the tap of PstRangeAction "pra_pst_fr" should be -15 in preventive
And the tap of PstRangeAction "pra_pst_be" should be 13 in preventive
And the tap of PstRangeAction "cra_pst_fr" should be -15 in preventive
And the tap of PstRangeAction "cra_pst_be" should be 13 in preventive
And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "pra_pst_fr" should be -14 in preventive
And the tap of PstRangeAction "cra_pst_fr" should be -14 in preventive
And the tap of PstRangeAction "pra_pst_be" should be 10 in preventive
And the tap of PstRangeAction "cra_pst_be" should be 10 in preventive

And 1 remedial actions are used after "CO1_fr2_fr3_1" at "curative"
# only one PST count as activated, as the other one didn't change its tap
And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "cra_pst_fr" should be -15 after "CO1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "cra_pst_be" should be 15 after "CO1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "pra_pst_fr" should be -15 after "CO1_fr2_fr3_1" at "curative"
# And the tap of PstRangeAction "pra_pst_be" should be 15 after "CO1_fr2_fr3_1" at "curative"
# does not work currently: expected behaviour not clear yet in that case
And the worst margin is 992 A
And the remedial action "cra_pst_fr" is not used after "CO1_fr2_fr3_1" at "curative"
And the remedial action "cra_pst_be" is not used after "CO1_fr2_fr3_1" at "curative"
And the worst margin is 996 A
Then the optimization steps executed by the RAO should be "SECOND_PREVENTIVE_IMPROVED_FIRST"

@fast @rao @mock @ac @second-preventive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ Feature: US 15.11.4: ARAO with 2P
Given crac file is "epic15/jsonCrac_ep15us11-4case2.json"
Given configuration file is "epic15/RaoParameters_ep15us11-4.json"
When I launch search_tree_rao at "2019-01-08 12:00"
Then 2 remedial actions are used in preventive
Then 1 remedial actions are used in preventive
And the remedial action "Open line NL1-NL2" is used in preventive
And the tap of PstRangeAction "PRA_CRA_PST_BE" should be -6 in preventive
And the remedial action "PRA_CRA_PST_BE" is not used in preventive
And 1 remedial actions are used after "Contingency_FR1_FR3" at "auto"
And the tap of PstRangeAction "ARA_PST_DE" should be 4 after "Contingency_FR1_FR3" at "auto"
And 1 remedial actions are used after "Contingency_FR1_FR3" at "curative"
And the tap of PstRangeAction "PRA_CRA_PST_BE" should be 16 after "Contingency_FR1_FR3" at "curative"
And 0 remedial actions are used after "Contingency_FR1_FR3" at "curative"
And the remedial action "PRA_CRA_PST_BE" is not used after "Contingency_FR1_FR3" at "curative"
And the worst margin is -141 MW
And the value of the objective function after CRA should be 141
And the margin on cnec "NL2-BE3-O - curative" after CRA should be 224 MW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: US 15.11.5: Additional tests to check various fixes concerning automato
When I launch search_tree_rao
And the remedial action "open_de1_de2_open_nl2_be3 - prev" is used in preventive
And the remedial action "open_de2_nl3 - co1 - auto" is used after "co1_fr2_de3" at "auto"
And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_de3" at "curative"
And the remedial action "pst_be" is not used after "co1_fr2_de3" at "curative"
And the margin on cnec "be1_be3_co1 - BBE1AA11->BBE3AA11 - co1_fr2_de3 - curative" after CRA should be 112.7 MW

@fast @rao @mock @dc @second-preventive
Expand Down Expand Up @@ -58,7 +58,7 @@ Feature: US 15.11.5: Additional tests to check various fixes concerning automato
And the remedial action "open_de1_de2_open_nl2_be3 - prev" is used in preventive
And the remedial action "open_de2_nl3 - co1 - auto" is used after "co1_fr2_de3" at "auto"
And the remedial action "close_fr2_de3 - co1 - auto" is not used after "co1_fr2_de3" at "auto"
And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_de3" at "curative"
And the remedial action "pst_be" is not used after "co1_fr2_de3" at "curative"
And the margin on cnec "be1_be3_co1 - BBE1AA11->BBE3AA11 - co1_fr2_de3 - curative" after PRA should be -293.5 MW
And the margin on cnec "be1_be3_co1 - BBE1AA11->BBE3AA11 - co1_fr2_de3 - auto" after ARA should be -360.65 MW
And the margin on cnec "be1_be3_co1 - BBE1AA11->BBE3AA11 - co1_fr2_de3 - curative" after CRA should be 112.7 MW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Feature: US 20.1: enable second optimization of the preventive perimeter

@fast @rao @mock @ac @second-preventive
Scenario: US 20.1.1: Preventive network actions only
Scenario: US 20.1.1.1: Preventive network actions only
Given network file is "common/TestCase16Nodes.uct"
Given crac file is "epic20/second_preventive_ls_1.json"
Given configuration file is "epic20/RaoParameters_maxMargin_ampere_second_preventive.json"
Expand All @@ -21,9 +21,9 @@ Feature: US 20.1: enable second optimization of the preventive perimeter
Then the optimization steps executed by the RAO should be "SECOND_PREVENTIVE_IMPROVED_FIRST"

@fast @rao @mock @ac @second-preventive
Scenario: US 20.1.1_bis: Same case as US 20.1.1 with a limitation of 2 RAs in preventive
Scenario: US 20.1.1.2: Same case as US 20.1.1 with a limitation of 2 RAs in preventive
Given network file is "common/TestCase16Nodes.uct"
Given crac file is "epic20/second_preventive_ls_1_bis.json"
Given crac file is "epic20/second_preventive_ls_1_2.json"
Given configuration file is "epic20/RaoParameters_maxMargin_ampere_second_preventive.json"
When I launch search_tree_rao
Then 2 remedial actions are used in preventive
Expand All @@ -33,14 +33,77 @@ Feature: US 20.1: enable second optimization of the preventive perimeter
Then the worst margin is 295.6 A

@fast @rao @mock @ac @second-preventive
Scenario: US 20.1.1_ter: Same case as US 20.1.1_bis with pst_fr available in curative
Scenario: US 20.1.1.3: Same case as US 20.1.1.1 with pst_fr available in curative
Given network file is "common/TestCase16Nodes.uct"
Given crac file is "epic20/second_preventive_ls_1_ter.json"
Given crac file is "epic20/second_preventive_ls_1_3.json"
Given configuration file is "epic20/RaoParameters_maxMargin_ampere_second_preventive.json"
When I launch search_tree_rao
# As pst_fr is both preventive and curative, it's excluded from the 2nd preventive.
# But we still consider it was applied in first preventive.
# Therefore, only 1 remedial action can be applied in 2nd preventive.
# We can re-optimize pst_fr even if it is preventive and curative for 2 reasons.
# 1- It has no range limitations based on previous instants.
# 2- There are no ra usage limits in curative.
# Therefore, we obtain better results.
Then 2 remedial actions are used in preventive
And the remedial action "open_fr1_fr3" is used in preventive
And the tap of PstRangeAction "pst_fr" should be 5 in preventive
And the tap of PstRangeAction "pst_be" should be -16 in preventive
Then the worst margin is 321 A

@fast @rao @mock @ac @second-preventive
Scenario: US 20.1.1.4: Same case as US 20.1.1.3 with pst_fr limits relative to preventive.
# We should have the same results as 20.1.1.2
Given network file is "common/TestCase16Nodes.uct"
Given crac file is "epic20/second_preventive_ls_1_4.json"
Given configuration file is "epic20/RaoParameters_maxMargin_ampere_second_preventive.json"
When I launch search_tree_rao
# We can not re-optimize pst_fr as its range limitation type is RELATIVE_TO_PREVIOUS_INSTANT.
Then 2 remedial actions are used in preventive
And the remedial action "open_fr1_fr3" is used in preventive
And the tap of PstRangeAction "pst_fr" should be -5 in preventive
And the tap of PstRangeAction "pst_be" should be 0 in preventive
Then the worst margin is 295.6 A

@fast @rao @mock @ac @second-preventive
Scenario: US 20.1.1.5: Same case as US 20.1.1.3 with curative maxRa limits.
# We should have the same results as 20.1.1.2
Given network file is "common/TestCase16Nodes.uct"
Given crac file is "epic20/second_preventive_ls_1_5.json"
Given configuration file is "epic20/RaoParameters_maxMargin_ampere_second_preventive.json"
When I launch search_tree_rao
# We can not re-optimize pst_fr for 2 combined reasons:
# 1- It has the same taps in preventive and in curative.
# 2- There are maxRa usage limits for curative instant.
Then 2 remedial actions are used in preventive
And the remedial action "open_fr1_fr3" is used in preventive
And the tap of PstRangeAction "pst_fr" should be -5 in preventive
And the tap of PstRangeAction "pst_be" should be 0 in preventive
Then the worst margin is 295.6 A

@fast @rao @mock @ac @second-preventive
Scenario: US 20.1.1.6: Same case as US 20.1.1.3 with curative maxPstPerTso limits.
# We should have the same results as 20.1.1.2
Given network file is "common/TestCase16Nodes.uct"
Given crac file is "epic20/second_preventive_ls_1_6.json"
Given configuration file is "epic20/RaoParameters_maxMargin_ampere_second_preventive.json"
When I launch search_tree_rao
# We can not re-optimize pst_fr for 2 combined reasons:
# 1- It has the same taps in preventive and in curative.
# 2- There are maxPstPerTso usage limits for curative instant.
Then 2 remedial actions are used in preventive
And the remedial action "open_fr1_fr3" is used in preventive
And the tap of PstRangeAction "pst_fr" should be -5 in preventive
And the tap of PstRangeAction "pst_be" should be 0 in preventive
Then the worst margin is 295.6 A

@fast @rao @mock @ac @second-preventive
Scenario: US 20.1.1.7: Same case as US 20.1.1.3 with curative maxRaPerTso limits.
# We should have the same results as 20.1.1.2
Given network file is "common/TestCase16Nodes.uct"
Given crac file is "epic20/second_preventive_ls_1_7.json"
Given configuration file is "epic20/RaoParameters_maxMargin_ampere_second_preventive.json"
When I launch search_tree_rao
# We can not re-optimize pst_fr for 2 combined reasons:
# 1- It has the same taps in preventive and in curative.
# 2- There are maxRaPerTso usage limits for curative instant.
Then 2 remedial actions are used in preventive
And the remedial action "open_fr1_fr3" is used in preventive
And the tap of PstRangeAction "pst_fr" should be -5 in preventive
Expand All @@ -60,9 +123,9 @@ Feature: US 20.1: enable second optimization of the preventive perimeter
Then 2 remedial actions are used in preventive
And the tap of PstRangeAction "pst_fr" should be -5 in preventive
And the remedial action "close_fr1_fr5" is used in preventive
And 2 remedial actions are used after "co1_fr2_fr3_1" at "curative"
And 1 remedial actions are used after "co1_fr2_fr3_1" at "curative"
And the remedial action "open_fr1_fr3" is used after "co1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_fr3_1" at "curative"
And the remedial action "pst_be" is not used in preventive
And the worst margin is 638 A
And the margin on cnec "FFR4AA1 DDE1AA1 1 - preventive" after PRA should be 638 A
And the margin on cnec "FFR1AA1 FFR4AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 645 A
Expand Down Expand Up @@ -116,10 +179,10 @@ Feature: US 20.1: enable second optimization of the preventive perimeter
Then 1 remedial actions are used in preventive
And the tap of PstRangeAction "pst_fr_pra" should be -7 in preventive
And the tap of PstRangeAction "pst_be" should be 0 in preventive
And 3 remedial actions are used after "co1_fr2_fr3_1" at "curative"
And 1 remedial actions are used after "co1_fr2_fr3_1" at "curative"
And the remedial action "close_fr1_fr5" is used after "co1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "pst_fr_cra" should be 1 after "co1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_fr3_1" at "curative"
And the remedial action "pst_fr_cra" is not used after "co1_fr2_fr3_1" at "curative"
And the remedial action "pst_be" is not used after "co1_fr2_fr3_1" at "curative"
Then the worst margin is 43 A
And the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be 43 A
And the margin on cnec "FFR2AA1 DDE3AA1 1 - co1_fr2_fr3_1 - outage" after PRA should be 385 A
Expand All @@ -137,9 +200,9 @@ Feature: US 20.1: enable second optimization of the preventive perimeter
Then 2 remedial actions are used in preventive
And the remedial action "close_fr1_fr5" is used in preventive
And the tap of PstRangeAction "pst_fr" should be -5 in preventive
And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative"
And 1 remedial actions are used after "CO1_fr2_fr3_1" at "curative"
And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative"
And the remedial action "pst_be" is not used after "CO1_fr2_fr3_1" at "curative"
And the worst margin is 638 A
And the margin on cnec "fr4_de1_N - preventive" after PRA should be 638 A
And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 645 A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ Feature: US 20.2: Handle loopflows in second preventive optimization
Given configuration file is "epic20/RaoParameters_maxMargin_MW_DC_withLF_with2P.json"
When I launch search_tree_rao at "2019-01-08 12:00"
Then 0 remedial actions are used in preventive
And the remedial action "CRA_PST_BE" is used after "CO1" at "curative"
And the remedial action "CRA_PST_BE" is not used after "CO1" at "curative"
And the worst margin is 500 MW
And the value of the objective function after CRA should be -500
And the remedial action "CRA_PST_BE" is used after "CO1" at "curative"
And the tap of PstRangeAction "CRA_PST_BE" should be 2 after "CO1" at "curative"
And the remedial action "CRA_PST_BE" is not used after "CO1" at "curative"
And the loopflow threshold on cnec "003_FR-DE - curative" should be 250 MW
And the initial loopflow on cnec "003_FR-DE - curative" should be -342 MW
And the loopflow on cnec "003_FR-DE - curative" after CRA should be -323 MW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Feature: US 20.4: Handle MNECs in second preventive optimization
Then 2 remedial actions are used in preventive
And the remedial action "Open line NL1-NL2" is used in preventive
And the tap of PstRangeAction "PRA_PST_BE" should be -3 in preventive
And 1 remedial actions are used after "Contingency_FR1_FR3" at "curative"
And the tap of PstRangeAction "CRA_PST_DE" should be 1 after "Contingency_FR1_FR3" at "curative"
And 0 remedial actions are used after "Contingency_FR1_FR3" at "curative"
And the remedial action "CRA_PST_DE" is not used after "Contingency_FR1_FR3" at "curative"
And the worst margin is -161 MW
And the value of the objective function after CRA should be 161
And the margin on cnec "FR2-FR3-O - preventive" after PRA should be -161 MW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Feature: US 20.5: Advanced 2nd preventive run conditions
Then 2 remedial actions are used in preventive
And the tap of PstRangeAction "pst_fr" should be -5 in preventive
And the remedial action "close_fr1_fr5" is used in preventive
And 2 remedial actions are used after "co1_fr2_fr3_1" at "curative"
And 1 remedial actions are used after "co1_fr2_fr3_1" at "curative"
And the remedial action "open_fr1_fr3" is used after "co1_fr2_fr3_1" at "curative"
And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_fr3_1" at "curative"
And the remedial action "pst_be" is not used after "co1_fr2_fr3_1" at "curative"
And the worst margin is 638 A
And the margin on cnec "FFR4AA1 DDE1AA1 1 - preventive" after PRA should be 638 A
And the margin on cnec "FFR1AA1 FFR4AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 645 A
Expand Down
Loading

0 comments on commit 16c3760

Please sign in to comment.