Integration Tests

This commit is contained in:
Mark McDowall 2024-01-03 17:05:40 -08:00
parent e4a46d4a33
commit 91661b7a72
2 changed files with 56 additions and 0 deletions

View File

@ -18,6 +18,10 @@ inputs:
filter:
description: 'Filter for tests'
required: true
binary_artifact:
description: 'Binary artifact for integration tests'
binary_path:
description: 'Path witin binary artifact for integration tests'
runs:
using: 'composite'
@ -44,11 +48,28 @@ runs:
name: ${{ inputs.artifact }}
path: _tests
- name: Download Binary Artifact
if: ${{ inputs.binary_artifact }}
uses: actions/download-artifact@v4
with:
name: ${{ inputs.binary_artifact }}
path: _artifacts
- name: Set up binary artifact
if: ${{ inputs.binary_path }}
shell: bash
run: mv ${{inputs.binary_path}} _tests/bin
- name: Make executable
if: startsWith(inputs.platform, '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
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 }}"

View File

@ -153,3 +153,38 @@ jobs:
pattern: Sonarr.*.Test.dll
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory!=IntegrationTest&TestCategory!=AutomationTest
use_postgres: true
integration_test:
needs: backend
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
artifact: tests-linux-x64
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory=IntegrationTest
binary_artifact: linux
binary_path: linux-x64/net6.0/Sonarr
- os: macos-latest
artifact: tests-osx-x64
filter: TestCategory!=ManualTest&TestCategory!=WINDOWS&TestCategory=IntegrationTest
binary_artifact: macos
binary_path: osx-x64/net6.0/Sonarr
- os: windows-latest
artifact: tests-win-x64
filter: TestCategory!=ManualTest&TestCategory=WINDOWS&TestCategory=IntegrationTest
binary_artifact: windows
binary_path: win-x64/net6.0/Sonarr
runs-on: ${{ matrix.os }}
steps:
- name: Check out
uses: actions/checkout@v3
- name: Test
uses: ./.github/actions/test
with:
platform: ${{ matrix.os }}
artifact: ${{ matrix.artifact }}
pattern: Sonarr.*.Test.dll
filter: ${{ matrix.filter }}
binary_artifact: