Fixes #4374 - Nukes all (?) legacy Driver and Application stuff; revamps tests (#4376)

This commit is contained in:
Tig
2025-11-11 16:29:33 -07:00
committed by GitHub
parent 559dea9239
commit d53fcd7485
310 changed files with 14827 additions and 16911 deletions

View File

@@ -1,4 +1,4 @@
name: Build Solution
name: Build Validation
on:
push:
@@ -9,18 +9,11 @@ on:
branches: [ v2_release, v2_develop ]
paths-ignore:
- '**.md'
workflow_call:
outputs:
artifact-name:
description: "Name of the build artifacts"
value: ${{ jobs.build.outputs.artifact-name }}
jobs:
build:
name: Build Debug & Release
build-validation:
name: Build All Configurations
runs-on: ubuntu-latest
outputs:
artifact-name: build-artifacts
timeout-minutes: 10
steps:
@@ -63,14 +56,3 @@ jobs:
- name: Build Release Solution
run: dotnet build --configuration Release --no-restore -property:NoWarn=0618%3B0612
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
**/bin/Debug/**
**/obj/Debug/**
**/bin/Release/**
**/obj/Release/**
retention-days: 1

View File

@@ -1,5 +1,4 @@
name: Build & Run Integration Tests
on:
push:
branches: [ v2_release, v2_develop ]
@@ -9,57 +8,99 @@ on:
branches: [ v2_release, v2_develop ]
paths-ignore:
- '**.md'
jobs:
# Call the build workflow to build the solution once
build:
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/quick-build.yml
integration_tests:
name: Integration Tests
runs-on: ${{ matrix.os }}
needs: build
strategy:
# Turn off fail-fast to let all runners run even if there are errors
fail-fast: true
fail-fast: false # Let all OSes finish even if one fails
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
timeout-minutes: 15
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-quality: ga
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-quality: 'ga'
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: test-build-artifacts
path: .
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: .
- name: Restore NuGet packages
run: dotnet restore
- name: Restore NuGet packages
run: dotnet restore
- name: Disable Windows Defender (Windows only)
if: runner.os == 'Windows'
shell: powershell
run: |
Add-MpPreference -ExclusionPath "${{ github.workspace }}"
Add-MpPreference -ExclusionProcess "dotnet.exe"
Add-MpPreference -ExclusionProcess "testhost.exe"
Add-MpPreference -ExclusionProcess "VSTest.Console.exe"
- name: Set VSTEST_DUMP_PATH
shell: bash
run: echo "{VSTEST_DUMP_PATH}={logs/${{ runner.os }}/}" >> $GITHUB_ENV
- name: Set VSTEST_DUMP_PATH
shell: bash
run: echo "VSTEST_DUMP_PATH=logs/IntegrationTests/${{ runner.os }}/" >> $GITHUB_ENV
- name: Run IntegrationTests
run: |
dotnet test Tests/IntegrationTests --no-build --verbosity normal --diag:logs/${{ runner.os }}/logs.txt --blame --blame-crash --blame-hang --blame-hang-timeout 60s --blame-crash-collect-always -- xunit.stopOnFail=true
- name: Upload Test Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-test-logs-${{ runner.os }}
path: |
logs/
TestResults/IntegrationTests/
- name: Run IntegrationTests
shell: bash
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
# Run with coverage on Linux only
dotnet test Tests/IntegrationTests \
--no-build \
--verbosity minimal \
--collect:"XPlat Code Coverage" \
--settings Tests/IntegrationTests/runsettings.coverage.xml \
--diag:logs/IntegrationTests/${{ runner.os }}/logs.txt \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 60s \
--blame-crash-collect-always
else
# Run without coverage on Windows/macOS for speed
dotnet test Tests/IntegrationTests \
--no-build \
--verbosity minimal \
--settings Tests/IntegrationTests/runsettings.xml \
--diag:logs/IntegrationTests/${{ runner.os }}/logs.txt \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 60s \
--blame-crash-collect-always
fi
- name: Upload Integration Test Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: integration_tests-logs-${{ runner.os }}
path: |
logs/IntegrationTests/
TestResults/
- name: Upload Integration Tests Coverage to Codecov
if: matrix.os == 'ubuntu-latest' && always()
uses: codecov/codecov-action@v4
with:
files: TestResults/**/coverage.cobertura.xml
flags: integrationtests
name: IntegrationTests-${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

43
.github/workflows/quick-build.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Quick Build for Tests
on:
workflow_call:
outputs:
artifact-name:
description: "Name of the build artifacts"
value: ${{ jobs.quick-build.outputs.artifact-name }}
jobs:
quick-build:
name: Build Debug Only
runs-on: ubuntu-latest
outputs:
artifact-name: test-build-artifacts
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-quality: 'ga'
- name: Restore dependencies
run: dotnet restore
# Suppress CS0618 (member is obsolete) and CS0612 (member is obsolete without message)
- name: Build Debug
run: dotnet build --configuration Debug --no-restore -property:NoWarn=0618%3B0612
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: test-build-artifacts
path: |
**/bin/Debug/**
**/obj/Debug/**
retention-days: 1

View File

@@ -11,9 +11,9 @@ on:
- '**.md'
jobs:
# Call the build workflow to build the solution once
# Call the quick-build workflow to build Debug configuration only
build:
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/quick-build.yml
non_parallel_unittests:
name: Non-Parallel Unit Tests
@@ -21,11 +21,11 @@ jobs:
needs: build
strategy:
# Turn off fail-fast to let all runners run even if there are errors
fail-fast: true
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
timeout-minutes: 10
timeout-minutes: 15 # Increased from 10 for Windows
steps:
- name: Checkout code
@@ -40,26 +40,56 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
name: test-build-artifacts
path: .
# KEEP THIS - It's needed for --no-build to work
- name: Restore NuGet packages
run: dotnet restore
# Test
# Note: The --blame and VSTEST_DUMP_PATH stuff is needed to diagnose the test runner crashing on ubuntu/mac
# See https://github.com/microsoft/vstest/issues/2952 for why the --blame stuff below is needed.
# Without it, the test runner crashes on ubuntu (but not Windows or mac)
# Optimize Windows performance
- name: Disable Windows Defender (Windows only)
if: runner.os == 'Windows'
shell: powershell
run: |
Add-MpPreference -ExclusionPath "${{ github.workspace }}"
Add-MpPreference -ExclusionProcess "dotnet.exe"
Add-MpPreference -ExclusionProcess "testhost.exe"
Add-MpPreference -ExclusionProcess "VSTest.Console.exe"
- name: Set VSTEST_DUMP_PATH
shell: bash
run: echo "{VSTEST_DUMP_PATH}={logs/UnitTests/${{ runner.os }}/}" >> $GITHUB_ENV
run: echo "VSTEST_DUMP_PATH=logs/UnitTests/${{ runner.os }}/" >> $GITHUB_ENV
- name: Run UnitTests
shell: bash
run: |
dotnet test Tests/UnitTests --no-build --verbosity normal --collect:"XPlat Code Coverage" --settings Tests/UnitTests/coverlet.runsettings --diag:logs/UnitTests/${{ runner.os }}/logs.txt --blame --blame-crash --blame-hang --blame-hang-timeout 60s --blame-crash-collect-always -- xunit.stopOnFail=false
# mv -v Tests/UnitTests/TestResults/*/*.* TestResults/UnitTests/
if [ "${{ runner.os }}" == "Linux" ]; then
# Run with coverage on Linux only
dotnet test Tests/UnitTests \
--no-build \
--verbosity normal \
--collect:"XPlat Code Coverage" \
--settings Tests/UnitTests/runsettings.xml \
--diag:logs/UnitTests/${{ runner.os }}/logs.txt \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 60s \
--blame-crash-collect-always
else
# Run without coverage on Windows/macOS for speed
dotnet test Tests/UnitTests \
--no-build \
--verbosity normal \
--settings Tests/UnitTests/runsettings.xml \
--diag:logs/UnitTests/${{ runner.os }}/logs.txt \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 120s \
--blame-crash-collect-always
fi
- name: Upload Test Logs
if: always()
@@ -68,19 +98,29 @@ jobs:
name: non_parallel_unittests-logs-${{ runner.os }}
path: |
logs/UnitTests
TestResults/UnitTests/
TestResults/
- name: Upload Non-Parallel UnitTests Coverage to Codecov
if: matrix.os == 'ubuntu-latest' && always()
uses: codecov/codecov-action@v4
with:
files: TestResults/**/coverage.cobertura.xml
flags: unittests-nonparallel
name: UnitTests-${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
parallel_unittests:
name: Parallel Unit Tests
runs-on: ${{ matrix.os }}
needs: build
strategy:
# Turn off fail-fast to let all runners run even if there are errors
fail-fast: true
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
timeout-minutes: 10
timeout-minutes: 15
steps:
- name: Checkout code
@@ -95,26 +135,54 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
name: test-build-artifacts
path: .
- name: Restore NuGet packages
run: dotnet restore
# Test
# Note: The --blame and VSTEST_DUMP_PATH stuff is needed to diagnose the test runner crashing on ubuntu/mac
# See https://github.com/microsoft/vstest/issues/2952 for why the --blame stuff below is needed.
# Without it, the test runner crashes on ubuntu (but not Windows or mac)
- name: Disable Windows Defender (Windows only)
if: runner.os == 'Windows'
shell: powershell
run: |
Add-MpPreference -ExclusionPath "${{ github.workspace }}"
Add-MpPreference -ExclusionProcess "dotnet.exe"
Add-MpPreference -ExclusionProcess "testhost.exe"
Add-MpPreference -ExclusionProcess "VSTest.Console.exe"
- name: Set VSTEST_DUMP_PATH
shell: bash
run: echo "{VSTEST_DUMP_PATH}={logs/UnitTestsParallelizable/${{ runner.os }}/}" >> $GITHUB_ENV
run: echo "VSTEST_DUMP_PATH=logs/UnitTestsParallelizable/${{ runner.os }}/" >> $GITHUB_ENV
- name: Run UnitTestsParallelizable
shell: bash
run: |
dotnet test Tests/UnitTestsParallelizable --no-build --verbosity normal --collect:"XPlat Code Coverage" --settings Tests/UnitTestsParallelizable/coverlet.runsettings --diag:logs/UnitTestsParallelizable/${{ runner.os }}/logs.txt --blame --blame-crash --blame-hang --blame-hang-timeout 60s --blame-crash-collect-always -- xunit.stopOnFail=false
# mv -v Tests/UnitTestsParallelizable/TestResults/*/*.* TestResults/UnitTestsParallelizable/
if [ "${{ runner.os }}" == "Linux" ]; then
# Run with coverage on Linux only
dotnet test Tests/UnitTestsParallelizable \
--no-build \
--verbosity normal \
--collect:"XPlat Code Coverage" \
--settings Tests/UnitTests/runsettings.coverage.xml \
--diag:logs/UnitTestsParallelizable/${{ runner.os }}/logs.txt \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 60s \
--blame-crash-collect-always
else
# Run without coverage on Windows/macOS for speed
dotnet test Tests/UnitTestsParallelizable \
--no-build \
--verbosity normal \
--settings Tests/UnitTestsParallelizable/runsettings.xml \
--diag:logs/UnitTestsParallelizable/${{ runner.os }}/logs.txt \
--blame \
--blame-crash \
--blame-hang \
--blame-hang-timeout 60s \
--blame-crash-collect-always
fi
- name: Upload UnitTestsParallelizable Logs
if: always()
@@ -123,4 +191,14 @@ jobs:
name: parallel_unittests-logs-${{ runner.os }}
path: |
logs/UnitTestsParallelizable/
TestResults/UnitTestsParallelizable/
TestResults/
- name: Upload Parallelizable UnitTests Coverage to Codecov
if: matrix.os == 'ubuntu-latest' && always()
uses: codecov/codecov-action@v4
with:
files: TestResults/**/coverage.cobertura.xml
flags: unittests-parallel
name: UnitTestsParallelizable-${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false