Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/base-installer-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,4 @@ jobs:
path: |
./*.log
./*.binlog
./Output/**/*.log
1 change: 1 addition & 0 deletions .github/workflows/patch-installer-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,6 @@ jobs:
path: |
./*.log
./*.binlog
./Output/**/*.log
./PatchableInstaller/CreateUpdatePatch/Master/AppHarvest.wxs
./PatchableInstaller/CreateUpdatePatch/Update/AppHarvest.wxs
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
69 changes: 33 additions & 36 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
Loading