Skip to content

Commit

Permalink
enable cucumber tests
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Feb 18, 2025
1 parent f062dea commit f695540
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 12 deletions.
166 changes: 164 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,172 @@ jobs:
- name: Init submodule Antares_Simulator_Tests_NR
run: |
git submodule update --init --remote --recursive src/tests/resources/Antares_Simulator_Tests_NR
- name: Run named mps tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-named-mps
os: ${{ env.os }}
variant: "named-mps"

- name: Run cucumber on short-tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/solver-features/short_tests.feature"

- name: Run unfeasibility-related tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
run: |
cd _build
ctest -C Release --output-on-failure -R "^unfeasible$"
- name: Run unit and end-to-end tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
run: |
cd _build
ctest -C Release --output-on-failure -L "unit|end-to-end"
- name: Upload logs for failed tests
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-log
path: ${{ github.workspace }}/_build/Testing/Temporary/LastTest.log

- name: Run tests about infinity on BCs RHS
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v830
os: ${{ env.os }}

- name: Run MILP with CBC
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-milp
variant: "milp-cbc"
os: ${{ env.os }}

- name: Run tests on adequacy patch (CSR)
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: adequacy-patch-CSR
os: ${{ env.os }}

- name: Run tests introduced in 8.6.0
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v860
os: ${{ env.os }}

- name: Run tests introduced in 8.7.0
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v870
os: ${{ env.os }}

- name: Run tests introduced in 9.1.0
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v910
os: ${{ env.os }}

- name: Run tests introduced in 9.2.0
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-v920
os: ${{ env.os }}

- name: Run short-tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: short-tests
os: ${{ env.os }}


- name: Run mps tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-mps
os: ${{ env.os }}

- name: Run parallel tests
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: valid-parallel
os: ${{ env.os }}
variant: "parallel"

- name: Run tests for time series generator tool
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: ts-generator
os: ${{ env.os }}
variant: "tsgenerator"

- name: Run medium-tests
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: medium-tests
os: ${{ env.os }}

- name: Run cucumber on medium-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/solver-features/medium_tests.feature"

- name: Run long-tests-1
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: long-tests-1
os: ${{ env.os }}

- name: Run long-tests-2
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: long-tests-2
os: ${{ env.os }}

- name: Run long-tests-3
if: ${{ env.RUN_EXTENDED_TESTS == 'true' && !cancelled() }}
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: long-tests-3
os: ${{ env.os }}

- name: Run cucumber on modeler
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }} #tmp
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/modeler-features"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ jobs:
os: ${{ env.os }}
variant: "named-mps"

- name: Run cucumber on short-tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && ! cancelled() }}
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/solver-features/short_tests.feature"

- name: Run unfeasibility-related tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && ! cancelled() }}
run: |
Expand Down Expand Up @@ -241,10 +247,6 @@ jobs:
batch-name: short-tests
os: ${{ env.os }}

- name: Run cucumber on short-tests
uses: ./.github/workflows/cucumber-tests
with:
feature: "features/solver-features/short_tests.feature"

- name: Run mps tests
if: ${{ env.RUN_SIMPLE_TESTS == 'true' && !cancelled() }}
Expand Down
14 changes: 8 additions & 6 deletions src/tests/cucumber/features/steps/common_steps/modeler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ def run_modeler(context):
print(f"Running command: {command}")
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = process.communicate()
print("*********************** Begin stdout ***********************")
print(out.replace(b'\r\n', b'\n').decode('utf-8'))
print("*********************** End stdout ***********************")

print("*********************** Begin stderr ***********************")
print(err.replace(b'\r\n', b'\n').decode('utf-8'))
print("*********************** End stderr ***********************")
if process.returncode != 0:
print("*********************** Begin stdout ***********************")
print(out.replace(b'\r\n', b'\n').decode('utf-8'))
print("*********************** End stdout ***********************")

print("*********************** Begin stderr ***********************")
print(err.replace(b'\r\n', b'\n').decode('utf-8'))
print("*********************** End stderr ***********************")

context.return_code = process.returncode

Expand Down

0 comments on commit f695540

Please sign in to comment.