Also fixed code coverage.

This commit is contained in:
Patrick Lehmann
2023-10-02 23:04:34 +02:00
parent 5237a1c53c
commit 582c5620b7
2 changed files with 5 additions and 2 deletions

View File

@@ -131,6 +131,7 @@ jobs:
continue-on-error: true continue-on-error: true
run: | run: |
export ENVIRONMENT_NAME="Linux (x86-64)" export ENVIRONMENT_NAME="Linux (x86-64)"
export PYTHONPATH=$(pwd)
ABSDIR=$(pwd) ABSDIR=$(pwd)
cd "${{ inputs.tests_directory || '.' }}" cd "${{ inputs.tests_directory || '.' }}"
[ -n '${{ inputs.coverage_config }}' ] && PYCOV_ARGS="--cov-config=${ABSDIR}/${{ inputs.coverage_config }}" || unset PYCOV_ARGS [ -n '${{ inputs.coverage_config }}' ] && PYCOV_ARGS="--cov-config=${ABSDIR}/${{ inputs.coverage_config }}" || unset PYCOV_ARGS

View File

@@ -195,7 +195,8 @@ jobs:
$env:PYTHONPATH = (Get-Location).ToString() $env:PYTHONPATH = (Get-Location).ToString()
cd "${{ inputs.tests_directory || '.' }}" cd "${{ inputs.tests_directory || '.' }}"
$PYTEST_ARGS = if ("${{ inputs.artifact }}") { "--junitxml=TestReportSummary.xml" } else { "" } $PYTEST_ARGS = if ("${{ inputs.artifact }}") { "--junitxml=TestReportSummary.xml" } else { "" }
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes Write-Host "python -m pytest -rA $PYTEST_ARGS --color=yes ${{ inputs.unittest_directory }}"
python -m pytest -rA $PYTEST_ARGS --color=yes ${{ inputs.unittest_directory }}
- name: ☑ Run unit tests (Ubuntu/macOS) - name: ☑ Run unit tests (Ubuntu/macOS)
if: matrix.system != 'windows' if: matrix.system != 'windows'
@@ -206,7 +207,8 @@ jobs:
cd "${{ inputs.tests_directory || '.' }}" cd "${{ inputs.tests_directory || '.' }}"
[ -n '${{ inputs.coverage_config }}' ] && PYCOV_ARGS="--cov-config=${ABSDIR}/${{ inputs.coverage_config }}" || unset PYCOV_ARGS [ -n '${{ inputs.coverage_config }}' ] && PYCOV_ARGS="--cov-config=${ABSDIR}/${{ inputs.coverage_config }}" || unset PYCOV_ARGS
[ -n '${{ inputs.artifact }}' ] && PYTEST_ARGS='--junitxml=TestReportSummary.xml' || unset PYTEST_ARGS [ -n '${{ inputs.artifact }}' ] && PYTEST_ARGS='--junitxml=TestReportSummary.xml' || unset PYTEST_ARGS
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes echo "python -m pytest -rA $PYTEST_ARGS --color=yes ${{ inputs.unittest_directory }}"
python -m pytest -rA $PYTEST_ARGS --color=yes ${{ inputs.unittest_directory }}
- name: 📤 Upload 'TestReportSummary.xml' artifact - name: 📤 Upload 'TestReportSummary.xml' artifact
if: inputs.artifact != '' if: inputs.artifact != ''