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

Add cucumber submodule for tests, remove Antares_Simulator_Tests_NR #2440

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ jobs:
run: |
git submodule update --init --remote --recursive src/tests/resources/Antares_Simulator_Tests

- name: Init submodule Antares_Simulator_Tests_NR
- name: Init submodule simulator-cucmber-tests
run: |
git submodule update --init --remote --recursive src/tests/resources/Antares_Simulator_Tests_NR
git submodule update --init --remote --recursive src/tests/cucumber/simulator-cucumber-tests

- name: Run named mps tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ jobs:
run: |
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests

- name: Init submodule Antares_Simulator_Tests_NR
- name: Init submodule simulator-cucmber-tests
run: |
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests_NR
git submodule update --init --remote --recursive src/tests/cucumber/simulator-cucumber-tests

- name: Enable git longpaths
run: git config --system core.longpaths true
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg.git
[submodule "src/tests/resources/Antares_Simulator_Tests_NR"]
path = src/tests/resources/Antares_Simulator_Tests_NR
url = https://github.com/AntaresSimulatorTeam/Antares_Simulator_Tests_NR.git
[submodule "src/tests/cucumber/simulator-cucumber-tests"]
path = src/tests/cucumber/simulator-cucumber-tests
url = https://github.com/AntaresSimulatorTeam/simulator-cucumber-tests
2 changes: 1 addition & 1 deletion src/tests/cucumber/features/medium_tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: medium tests

@fast @medium @incomplete
Scenario: 035 Mixed Expansion - Smart grid model 2
Given the study path is "medium-tests/035 Mixed Expansion - Smart grid model 2"
Given the study path is "035 Mixed Expansion - Smart grid model 2"
Copy link
Contributor

@a-zakir a-zakir Oct 7, 2024

Choose a reason for hiding this comment

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

you can take advantage of this new repo to remove withespaces from study folder

When I run antares simulator
Then the simulation takes less than 15 seconds
And the simulation succeeds
Expand Down
12 changes: 6 additions & 6 deletions src/tests/cucumber/features/short_tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: short tests

@fast @short
Scenario: 001 One node - passive
Given the study path is "short-tests/001 One node - passive"
Given the study path is "001 One node - passive"
When I run antares simulator
Then the simulation takes less than 5 seconds
And the simulation succeeds
Expand All @@ -12,7 +12,7 @@ Feature: short tests

@fast @short
Scenario: 002 Thermal fleet - Base
Given the study path is "short-tests/002 Thermal fleet - Base"
Given the study path is "002 Thermal fleet - Base"
When I run antares simulator
Then the simulation takes less than 5 seconds
And the simulation succeeds
Expand All @@ -24,7 +24,7 @@ Feature: short tests

@fast @short
Scenario: 003 Thermal fleet - Must-run
Given the study path is "short-tests/003 Thermal fleet - Must-run"
Given the study path is "003 Thermal fleet - Must-run"
When I run antares simulator
Then the simulation takes less than 5 seconds
And the simulation succeeds
Expand All @@ -36,10 +36,10 @@ Feature: short tests

@fast @short
Scenario: 021 Four areas - DC law
Given the study path is "short-tests/021 Four areas - DC law"
Given the study path is "021 Four areas - DC law-simplified"
When I run antares simulator
Then the simulation takes less than 20 seconds
And the simulation succeeds
And the annual system cost is
| EXP | STD | MIN | MAX |
| 7.972e+10 | 2.258e+10 | 5.613e+10 | 1.082e+11 |
| EXP | STD | MIN | MAX |
Copy link
Contributor

Choose a reason for hiding this comment

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

why?

Copy link
Member Author

Choose a reason for hiding this comment

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

Slight change of results after the study was cleaned up (100 TS -> 3 TS)

| 6.5397e+10| 2.97462e+09 | 6.10076e+10 | 6.84837e+10 |
2 changes: 1 addition & 1 deletion src/tests/cucumber/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@given('the study path is "{string}"')
def study_path_is(context, string):
context.study_path = os.path.join("..", "resources", "Antares_Simulator_Tests_NR" , string.replace("/", os.sep))
context.study_path = os.path.join("simulator-cucumber-tests", string.replace("/", os.sep))

@when('I run antares simulator')
def run_antares(context):
Expand Down
7 changes: 2 additions & 5 deletions src/tests/cucumber/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ Workflow file: [here](../../../.github/workflows/cucumber-tests/action.yml)

## Under the hood
### Test files
Tests are hosted in the [Antares_Simulator_Tests_NR submodule](https://github.com/AntaresSimulatorTeam/Antares_Simulator_Tests_NR)
into the `src/test/resources` folder. Adding or modifying a study should thus change contents of this submodule.
Tests are hosted in the [simulator-cucumber-tests submodule](https://github.com/AntaresSimulatorTeam/simulator-cucumber-tests) into the `src/test/cucmber` folder. Adding or modifying a study should thus change contents of this submodule.

### Code-behind
All Gherkin steps have a code-behind definition called "step definitions". These are defined in the python files under
[features/steps](./features/steps) and use the [behave](https://behave.readthedocs.io/en/latest/) implementation of
cucumber. Feel free to add extra steps for your tests.
All Gherkin steps have a code-behind definition called "step definitions". These are defined in the python files under [features/steps](./features/steps) and use the [behave](https://behave.readthedocs.io/en/latest/) implementation of cucumber. Feel free to add extra steps for your tests.
1 change: 1 addition & 0 deletions src/tests/cucumber/simulator-cucumber-tests
1 change: 0 additions & 1 deletion src/tests/resources/Antares_Simulator_Tests_NR
Submodule Antares_Simulator_Tests_NR deleted from 998378
Loading