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

Test: Coverage modification #685

Closed
wants to merge 7 commits into from
Closed
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
51 changes: 38 additions & 13 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,15 @@ jobs:
echo "matrix={\"mechanical-version\":['${{ needs.revn-variations.outputs.test_docker_image_version }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT
fi

tests:
name: Testing and coverage - Mechanical ${{ matrix.mechanical-version }}
remote-connect:
name: Remote connect testing and coverage - Mechanical ${{ matrix.mechanical-version }}
runs-on: public-ubuntu-latest-8-cores
needs: [smoke-tests, revn-variations, config-matrix]
needs: [revn-variations, config-matrix]
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.config-matrix.outputs.matrix) }}

steps:
- name: Login in Github Container registry
uses: docker/login-action@v3
Expand All @@ -154,13 +155,37 @@ jobs:
docker run --restart always --name ${{ env.DOCKER_MECH_CONTAINER_NAME }} -e ANSYSLMD_LICENSE_FILE=1055@${{ env.LICENSE_SERVER }} -p ${{ env.PYMECHANICAL_PORT }}:10000 ${{ env.MECHANICAL_IMAGE }} > log.txt &
grep -q 'WB Initialize Done' <(timeout 60 tail -f log.txt)

- name: Testing
uses: ansys/actions/tests-pytest@v5
- uses: actions/checkout@v4

- name: "Set up Python"
uses: ansys/actions/[email protected]
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
python-version: ${{ env.MAIN_PYTHON_VERSION}}
use-cache: false

- name: Create and activate virtual environment
run: |
python -m venv .venv
source .venv/bin/activate

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[tests]

- name: Remote connect test
run: |
pytest -m remote_session_connect -s --junitxml remote_results${{ env.MAIN_PYTHON_VERSION}}.xml --cov=ansys.mechanical --cov-report html:.cov/html|| true

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/remote_results*.xml'
check_name: Remote Connect Report ${{ env.MAIN_PYTHON_VERSION}}
detailed_summary: true
include_passed: true
fail_on_failure: true

- name: Upload coverage results
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -199,7 +224,7 @@ jobs:
name: Embedding testing and coverage
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [style, revn-variations]
needs: [revn-variations]
container:
image: ${{ needs.revn-variations.outputs.test_container }}
options: --entrypoint /bin/bash
Expand Down Expand Up @@ -241,7 +266,7 @@ jobs:
PYTHONUNBUFFERED: 1
run: |
. /env/bin/activate
xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true
xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml --cov=ansys.mechanical --cov-report html:.cov/html|| true

- name: Upload coverage results
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -276,7 +301,7 @@ jobs:
container:
image: ${{ needs.revn-variations.outputs.test_container }}
options: --entrypoint /bin/bash
needs: [ smoke-tests, revn-variations]
needs: [revn-variations]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -443,7 +468,7 @@ jobs:

coverage:
name: Merging coverage
needs: [tests, embedding-tests, launch-tests]
needs: [remote-connect, embedding-tests, launch-tests]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -520,7 +545,7 @@ jobs:

package:
name: Package library
needs: [tests, embedding-tests, doc-build]
needs: [remote-connect, embedding-tests, launch-tests, doc-build, coverage]
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/685.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test: Coverage modification
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ output = ".cov/coverage.xml"

[tool.pytest.ini_options]
minversion = "7.1"
addopts = """-ra -s -m remote_session_connect --durations=0 --cov=ansys.mechanical --cov-report html:.cov/html \
addopts = """-ra -s --durations=0 --cov=ansys.mechanical --cov-report html:.cov/html \
--cov-report xml:.cov/xml --cov-report term -vv --print --print-relative-time"""
# addopts = """-ra -s -m remote_session_launch --durations=0 --cov=ansys.mechanical --cov-report html:.cov/html \
# --cov-report xml:.cov/xml --cov-report term -vv --print --print-relative-time"""
Expand Down
Loading