diff --git a/.github/workflows/base-installer-cd.yml b/.github/workflows/base-installer-cd.yml index 22d1e51e42..be6cb0dcd4 100644 --- a/.github/workflows/base-installer-cd.yml +++ b/.github/workflows/base-installer-cd.yml @@ -308,3 +308,4 @@ jobs: path: | ./*.log ./*.binlog + ./Output/**/*.log diff --git a/.github/workflows/patch-installer-cd.yml b/.github/workflows/patch-installer-cd.yml index 62ef1c0a9c..b1e0150518 100644 --- a/.github/workflows/patch-installer-cd.yml +++ b/.github/workflows/patch-installer-cd.yml @@ -293,5 +293,6 @@ jobs: path: | ./*.log ./*.binlog + ./Output/**/*.log ./PatchableInstaller/CreateUpdatePatch/Master/AppHarvest.wxs ./PatchableInstaller/CreateUpdatePatch/Update/AppHarvest.wxs diff --git a/.gitignore b/.gitignore index 5f9a5c9f92..b7a346e6f1 100644 --- a/.gitignore +++ b/.gitignore @@ -114,6 +114,8 @@ Lib/src/Enchant/fieldworks-enchant-1.6.1/ Src/Kernel/FwKernelTlb.idl Src/Kernel/*.idh Src/Kernel/libFwKernel +Src/Utilities/pcpatrflex/PrepFLExDBDll/PrepFLExDBTests/TestData/SharedSettings +Src/Utilities/pcpatrflex/PrepFLExDBDll/PrepFLExDBTests/TestData/WritingSystemStore Src/views/libViews Src/views/libVwGraphics Src/views/Test/Release/ diff --git a/build.ps1 b/build.ps1 index f51fff8bb7..a7181b885a 100644 --- a/build.ps1 +++ b/build.ps1 @@ -630,42 +630,6 @@ try { Write-Host "Output: Output\$Configuration" -ForegroundColor Cyan } - # ============================================================================= - # Test Execution (Optional) - # ============================================================================= - # Run tests BEFORE the installer build because the installer's CleanAll target - # (enabled on CI via InstallerCleanProductOutputs=true) wipes Output/ and - # rebuilds without /p:BuildTests=true, removing all *Tests.dll assemblies. - - if ($RunTests) { - Write-Host "" - Write-Host "Running tests..." -ForegroundColor Cyan - - $testArgs = @{ - Configuration = $Configuration - NoBuild = $true - Verbosity = $Verbosity - SkipDependencyCheck = $SkipDependencyCheck - SkipWorktreeLock = $true - } - if ($TestFilter) { - $testArgs["TestFilter"] = $TestFilter - } - - Stop-ConflictingProcesses @cleanupArgs - & "$PSScriptRoot\test.ps1" @testArgs - $script:testExitCode = $LASTEXITCODE - if ($script:testExitCode -eq 1) { - # VSTest exit code 1 means tests were skipped (or skipped+failed). test.ps1 prints a - # FAIL summary when there are actual failures, so treat exit code 1 as a warning only - # to avoid failing the build when the only non-passing tests were skipped. - Write-Warning "Test run exited with code 1 (skipped tests or failures). Check test output above for details." - $script:testExitCode = 0 - } elseif ($script:testExitCode -ne 0) { - Write-Warning "Some tests failed (exit code: $($script:testExitCode)). Check output above for details." - } - } - if ($BuildInstaller -or $BuildPatch) { if ($BuildPatch) { $BaseOrPatch = "Patch" @@ -716,6 +680,39 @@ try { Write-Host "[OK] $BaseOrPatch build complete!" -ForegroundColor Green } } + + # ============================================================================= + # Test Execution (Optional) + # ============================================================================= + + if ($RunTests) { + Write-Host "" + Write-Host "Running tests..." -ForegroundColor Cyan + + $testArgs = @{ + Configuration = $Configuration + NoBuild = $true + Verbosity = $Verbosity + SkipDependencyCheck = $SkipDependencyCheck + SkipWorktreeLock = $true + } + if ($TestFilter) { + $testArgs["TestFilter"] = $TestFilter + } + + Stop-ConflictingProcesses @cleanupArgs + & "$PSScriptRoot\test.ps1" @testArgs + $script:testExitCode = $LASTEXITCODE + if ($script:testExitCode -eq 1) { + # VSTest exit code 1 means tests were skipped (or skipped+failed). test.ps1 prints a + # FAIL summary when there are actual failures, so treat exit code 1 as a warning only + # to avoid failing the build when the only non-passing tests were skipped. + Write-Warning "Test run exited with code 1 (skipped tests or failures). Check test output above for details." + $script:testExitCode = 0 + } elseif ($script:testExitCode -ne 0) { + Write-Warning "Some tests failed (exit code: $($script:testExitCode)). Check output above for details." + } + } } finally { # Kill any lingering build processes that might hold file locks