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

Fix/coverage short #8

Merged
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
22 changes: 20 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ jobs:
python -m pip install --upgrade pip
pip3 install -r src/tests/examples/requirements.txt

- name: Read simtest version
run: |
echo 'SIMTEST_JSON<<EOF' >> $GITHUB_ENV
cat ./simtest.json >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV

- name: Export simtest version
run: |
echo "SIMTEST=${{ fromJson(env.SIMTEST_JSON).version }}" >> $GITHUB_ENV

- name: Init submodule
run: |
git submodule update --init --remote src/tests/resources/Antares_Simulator_Tests
Expand All @@ -93,7 +103,7 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DCODE_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="../install;${{ env.ORTOOLS_DIR }}/install" \
-DBUILD_TESTING=ON \
-DMZ_CODE_COVERAGE=ON \
Expand All @@ -102,14 +112,22 @@ jobs:

- name: Build
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build _build --config release -j$(nproc)
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build _build --config Release -j$(nproc)

- name: Test and generate coverage
continue-on-error: true
run: |
cd $GITHUB_WORKSPACE/_build
ctest -C Release --output-on-failure -L "unit"

- name: Run short-tests
continue-on-error: true
uses: ./.github/workflows/run-tests
with:
simtest-tag: ${{ env.SIMTEST }}
batch-name: short-tests
os: ${{ matrix.os }}

- name: Collect coverage into one XML report
run: |
gcovr --sonarqube --output coverage.xml
Expand Down
2 changes: 1 addition & 1 deletion src/tests/run-study-tests/actions_on_study/study_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def run(self):
if not self.raise_exception_on_failure:
return

check(self.return_code == 0, "Solver returned error")
check(self.success(), f"Solver returned error {self.return_code}")


def get_return_code(self):
Expand Down
Loading