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: inputs:
use_postgres: use_postgres:
description: 'Whether postgres should be used for the database' description: 'Whether postgres should be used for the database'
platform: os:
description: 'OS platform that the tests are running on' description: 'OS that the tests are running on'
required: true required: true
artifact: artifact:
description: 'Test binary artifact' description: 'Test binary artifact'
@ -18,9 +18,10 @@ inputs:
filter: filter:
description: 'Filter for tests' description: 'Filter for tests'
required: true required: true
integation_tests:
description: 'True if running integration tests'
binary_artifact: binary_artifact:
description: 'Binary artifact for integration tests' description: 'Binary artifact for integration tests'
default: ''
binary_path: binary_path:
description: 'Path witin binary artifact for integration tests' description: 'Path witin binary artifact for integration tests'
@ -57,20 +58,20 @@ runs:
path: _artifacts path: _artifacts
- name: Set up binary artifact - name: Set up binary artifact
if: ${{ inputs.binary_path }} if: ${{ inputs.binary_path != '' }}
shell: bash shell: bash
run: mv ${{inputs.binary_path}} _tests/bin run: mv ${{inputs.binary_path}} _tests/bin
- name: Make executable - name: Make executable
if: startsWith(inputs.platform, 'windows') != true if: startsWith(inputs.os, 'windows') != true
shell: bash shell: bash
run: chmod +x ./_tests/Sonarr.Test.Dummy && chmod +x ./_tests/ffprobe run: chmod +x ./_tests/Sonarr.Test.Dummy && chmod +x ./_tests/ffprobe
- name: Make Sonarr binary executable - name: Make Sonarr binary executable
if: ${{ inputs.binary_path }} != '' && startsWith(inputs.platform, 'windows') != true if: ${{ integation_tests && !startsWith(inputs.os, 'windows') }}
shell: bash shell: bash
run: chmod +x ./_tests/bin/Sonarr run: chmod +x ./_tests/bin/Sonarr
- name: Run tests - name: Run tests
shell: bash 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 - name: Test
uses: ./.github/actions/test uses: ./.github/actions/test
with: with:
platform: ${{ matrix.os }} os: ${{ matrix.os }}
artifact: ${{ matrix.artifact }} artifact: ${{ matrix.artifact }}
pattern: Sonarr.*.Test.dll pattern: Sonarr.*.Test.dll
filter: ${{ matrix.filter }} filter: ${{ matrix.filter }}
@ -148,7 +148,7 @@ jobs:
- name: Test - name: Test
uses: ./.github/actions/test uses: ./.github/actions/test
with: with:
platform: ubuntu-latest os: ubuntu-latest
artifact: tests-linux-x64 artifact: tests-linux-x64
pattern: Sonarr.*.Test.dll pattern: Sonarr.*.Test.dll
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory!=IntegrationTest&TestCategory!=AutomationTest filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory!=IntegrationTest&TestCategory!=AutomationTest
@ -183,8 +183,10 @@ jobs:
- name: Test - name: Test
uses: ./.github/actions/test uses: ./.github/actions/test
with: with:
platform: ${{ matrix.os }} os: ${{ matrix.os }}
artifact: ${{ matrix.artifact }} artifact: ${{ matrix.artifact }}
pattern: Sonarr.*.Test.dll pattern: Sonarr.*.Test.dll
filter: ${{ matrix.filter }} filter: ${{ matrix.filter }}
binary_artifact: integration_test: true
binary_artifact: ${{ matrix.binary_artifact }}
binary_path: ${{ matrix.binary_path }}