Explict integration tests

This commit is contained in:
Mark McDowall 2024-01-04 11:24:57 -08:00
parent 8b9a642cc5
commit a29cca9d55
2 changed files with 14 additions and 11 deletions

View File

@ -6,8 +6,8 @@ description: Runs unit/integration tests
inputs:
use_postgres:
description: 'Whether postgres should be used for the database'
platform:
description: 'OS platform that the tests are running on'
os:
description: 'OS that the tests are running on'
required: true
artifact:
description: 'Test binary artifact'
@ -18,9 +18,10 @@ inputs:
filter:
description: 'Filter for tests'
required: true
integation_tests:
description: 'True if running integration tests'
binary_artifact:
description: 'Binary artifact for integration tests'
default: ''
binary_path:
description: 'Path witin binary artifact for integration tests'
@ -57,20 +58,20 @@ runs:
path: _artifacts
- name: Set up binary artifact
if: ${{ inputs.binary_path }}
if: ${{ inputs.binary_path != '' }}
shell: bash
run: mv ${{inputs.binary_path}} _tests/bin
- name: Make executable
if: startsWith(inputs.platform, 'windows') != true
if: startsWith(inputs.os, 'windows') != true
shell: bash
run: chmod +x ./_tests/Sonarr.Test.Dummy && chmod +x ./_tests/ffprobe
- name: Make Sonarr binary executable
if: ${{ inputs.binary_path }} != '' && startsWith(inputs.platform, 'windows') != true
if: ${{ integation_tests && !startsWith(inputs.os, 'windows') }}
shell: bash
run: chmod +x ./_tests/bin/Sonarr
- name: Run tests
shell: bash
run: dotnet test ./_tests/Sonarr.*.Test.dll --filter "${{ inputs.filter }}" --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
run: dotnet test ./_tests/Sonarr.*.Test.dll --filter "${{ inputs.filter }}" --logger trx --results-directory "${{ inputs.integration_tests && integation_ || unit_ }}${{ env.platform }}"

View File

@ -133,7 +133,7 @@ jobs:
- name: Test
uses: ./.github/actions/test
with:
platform: ${{ matrix.os }}
os: ${{ matrix.os }}
artifact: ${{ matrix.artifact }}
pattern: Sonarr.*.Test.dll
filter: ${{ matrix.filter }}
@ -148,7 +148,7 @@ jobs:
- name: Test
uses: ./.github/actions/test
with:
platform: ubuntu-latest
os: ubuntu-latest
artifact: tests-linux-x64
pattern: Sonarr.*.Test.dll
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory!=IntegrationTest&TestCategory!=AutomationTest
@ -183,8 +183,10 @@ jobs:
- name: Test
uses: ./.github/actions/test
with:
platform: ${{ matrix.os }}
os: ${{ matrix.os }}
artifact: ${{ matrix.artifact }}
pattern: Sonarr.*.Test.dll
filter: ${{ matrix.filter }}
binary_artifact:
integration_test: true
binary_artifact: ${{ matrix.binary_artifact }}
binary_path: ${{ matrix.binary_path }}