From 81c1f128360e24745ca1acd123c2901286039b89 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 3 Nov 2022 07:55:45 +0100 Subject: [PATCH] Fixed path to coverage config file. --- .github/workflows/CoverageCollection.yml | 8 ++++---- .github/workflows/UnitTesting.yml | 8 ++++---- ExamplePipeline.yml | 4 ++-- doc/JobTemplate/CoverageCollection.rst | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/CoverageCollection.yml b/.github/workflows/CoverageCollection.yml index 12b85b4..074c0f0 100644 --- a/.github/workflows/CoverageCollection.yml +++ b/.github/workflows/CoverageCollection.yml @@ -35,13 +35,13 @@ on: required: false default: '-r tests/requirements.txt' type: string - test_directory: + tests_directory: description: 'Path to the directory containing tests (test working directory).' required: false default: 'tests' type: string unittest_directory: - description: 'Path to the directory containing unit tests (relative to test_directory).' + description: 'Path to the directory containing unit tests (relative to tests_directory).' required: false default: 'unit' type: string @@ -127,8 +127,8 @@ jobs: - name: Collect coverage continue-on-error: true run: | - cd ${{ inputs.test_directory }} - [ 'x${{ inputs.coverage_config }}' != 'x' ] && PYCOV_ARGS='--cov-config=${{ inputs.coverage_config }}' || unset PYCOV_ARGS + cd ${{ inputs.tests_directory }} + [ 'x${{ inputs.coverage_config }}' != 'x' ] && PYCOV_ARGS='--cov-config=../${{ inputs.coverage_config }}' || unset PYCOV_ARGS python -m pytest -rA --cov=. $PYCOV_ARGS ${{ inputs.unittest_directory }} --color=yes - name: Convert to cobertura format diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 859cc8a..831db64 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -97,13 +97,13 @@ jobs: with: python-version: ${{ matrix.python }} - - name: 🔧 Install wheel and pip dependencies + - name: 🔧 Install wheel and pip dependencies (native) if: matrix.system != 'msys2' run: | python -m pip install --disable-pip-version-check -U wheel python -m pip install --disable-pip-version-check ${{ inputs.requirements }} - - name: 🔧 Install pip dependencies + - name: 🔧 Install pip dependencies (MSYS2) if: matrix.system == 'msys2' run: | if [ 'x${{ inputs.mingw_requirements }}' != 'x' ]; then @@ -112,14 +112,14 @@ jobs: python -m pip install --disable-pip-version-check ${{ inputs.requirements }} fi - - name: ☑ Run unit tests + - name: ☑ Run unit tests (Windows) if: matrix.system == 'windows' run: | cd ${{ inputs.tests_directory }} $PYTEST_ARGS = if ("${{ inputs.artifact }}".length -gt 0) { "--junitxml=TestReportSummary.xml" } else { "" } python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes - - name: ☑ Run unit tests + - name: ☑ Run unit tests (Ubuntu/macOS) if: matrix.system != 'windows' run: | cd ${{ inputs.tests_directory }} diff --git a/ExamplePipeline.yml b/ExamplePipeline.yml index f9c63d5..30fa4ee 100644 --- a/ExamplePipeline.yml +++ b/ExamplePipeline.yml @@ -52,7 +52,7 @@ jobs: python-coverage:p python-lxml:p mingw_requirements: '-r tests/requirements.mingw.txt' - test_directory: 'tests' + tests_directory: 'tests' unittest_directory: 'unit' artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }} @@ -65,7 +65,7 @@ jobs: # Optional python_version: ${{ fromJson(needs.Params.outputs.params).python_version }} requirements: '-r tests/requirements.txt' - test_directory: 'tests' + tests_directory: 'tests' unittest_directory: 'unit' secrets: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} diff --git a/doc/JobTemplate/CoverageCollection.rst b/doc/JobTemplate/CoverageCollection.rst index 052ba55..d32af78 100644 --- a/doc/JobTemplate/CoverageCollection.rst +++ b/doc/JobTemplate/CoverageCollection.rst @@ -122,7 +122,7 @@ unittest_directory | unittest_directory | optional | string | ``unit`` | +--------------------+----------+----------+-----------+ -Path to the directory containing unit tests (relative to test_directory). +Path to the directory containing unit tests (relative to tests_directory). coverage_config