diff --git a/.github/workflows/ApplicationTesting.yml b/.github/workflows/ApplicationTesting.yml index 64b12a3..afceb3c 100644 --- a/.github/workflows/ApplicationTesting.yml +++ b/.github/workflows/ApplicationTesting.yml @@ -49,11 +49,16 @@ on: required: false default: '' type: string - tests_directory: - description: 'Path to the directory containing tests (test working directory).' + root_directory: + description: 'Working directory for running tests.' required: false default: '' type: string + tests_directory: + description: 'Path to the directory containing tests (relative to root_directory).' + required: false + default: 'tests' + type: string apptest_directory: description: 'Path to the directory containing application tests (relative to tests_directory).' required: false @@ -66,7 +71,6 @@ on: type: string jobs: - ApplicationTesting: name: ${{ matrix.sysicon }} ${{ matrix.pyicon }} Application Tests using Python ${{ matrix.python }} runs-on: ${{ matrix.runs-on }} @@ -207,7 +211,7 @@ jobs: run: | export ENVIRONMENT_NAME="${{ matrix.envname }}" - cd "${{ inputs.tests_directory || '.' }}" + cd "${{ inputs.root_directory || '.' }}" [ -n '${{ inputs.apptest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS if [ -n '${{ inputs.coverage_config }}' ]; then echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}" @@ -222,7 +226,7 @@ jobs: run: | $env:ENVIRONMENT_NAME = "${{ matrix.envname }}" - cd "${{ inputs.tests_directory || '.' }}" + cd "${{ inputs.root_directory || '.' }}" $PYTEST_ARGS = if ("${{ inputs.apptest_xml_artifact }}") { "--junitxml=report/unit/TestReportSummary.xml" } else { "" } if ("${{ inputs.coverage_config }}") { Write-Host "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}" @@ -236,7 +240,7 @@ jobs: if: inputs.apptest_xml_artifact != '' uses: actions/upload-artifact@v4 with: - name: ${{ inputs.apptest_xml_artifact }}-${{ matrix.system }}-${{ matrix.python }} - path: ${{ inputs.tests_directory || '.' }}/TestReportSummary.xml + name: ${{ inputs.apptest_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }} + path: report/unit/TestReportSummary.xml if-no-files-found: error retention-days: 1 diff --git a/.github/workflows/UnitTesting.yml b/.github/workflows/UnitTesting.yml index 6ab964a..81e8657 100644 --- a/.github/workflows/UnitTesting.yml +++ b/.github/workflows/UnitTesting.yml @@ -44,11 +44,16 @@ on: required: false default: '' type: string - tests_directory: - description: 'Path to the directory containing tests (test working directory).' + root_directory: + description: 'Working directory for running tests.' required: false default: '' type: string + tests_directory: + description: 'Path to the directory containing tests (relative to root_directory).' + required: false + default: 'tests' + type: string unittest_directory: description: 'Path to the directory containing unit tests (relative to tests_directory).' required: false @@ -293,7 +298,7 @@ jobs: export ENVIRONMENT_NAME="${{ matrix.envname }}" export PYTHONPATH=$(pwd) - cd "${{ inputs.tests_directory || '.' }}" + cd "${{ inputs.root_directory || '.' }}" [ -n '${{ inputs.unittest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS if [ -n '${{ inputs.coverage_config }}' ]; then echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}" @@ -309,7 +314,7 @@ jobs: $env:ENVIRONMENT_NAME = "${{ matrix.envname }}" $env:PYTHONPATH = (Get-Location).ToString() - cd "${{ inputs.tests_directory || '.' }}" + cd "${{ inputs.root_directory || '.' }}" $PYTEST_ARGS = if ("${{ inputs.unittest_xml_artifact }}") { "--junitxml=report/unit/TestReportSummary.xml" } else { "" } if ("${{ inputs.coverage_config }}") { Write-Host "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"