1 Star 0 Fork 0

寒月笑天/NuGet.Server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test.ps1 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
[CmdletBinding(DefaultParameterSetName='RegularBuild')]
param (
[ValidateSet("debug", "release")]
[string]$Configuration = 'debug',
[int]$BuildNumber
)
# For TeamCity - If any issue occurs, this script fail the build. - By default, TeamCity returns an exit code of 0 for all powershell scripts, even if they fail
trap {
Write-Host "BUILD FAILED: $_" -ForegroundColor Red
Write-Host "ERROR DETAILS:" -ForegroundColor Red
Write-Host $_.Exception -ForegroundColor Red
Write-Host ("`r`n" * 3)
exit 1
}
. "$PSScriptRoot\build\common.ps1"
Function Run-Tests {
[CmdletBinding()]
param()
Trace-Log 'Running tests'
$xUnitExe = (Join-Path $PSScriptRoot "packages\xunit.runner.console.2.1.0\tools\xunit.console.exe")
$TestAssemblies = "test\NuGet.Server.Core.Tests\bin\$Configuration\NuGet.Server.Core.Tests.dll", `
"test\NuGet.Server.V2.Tests\bin\$Configuration\NuGet.Server.V2.Tests.dll", `
"test\NuGet.Server.Tests\bin\$Configuration\NuGet.Server.Tests.dll"
$TestCount = 0
foreach ($Test in $TestAssemblies) {
& $xUnitExe (Join-Path $PSScriptRoot $Test) -xml "Results.$TestCount.xml"
$TestCount++
}
}
Write-Host ("`r`n" * 3)
Trace-Log ('=' * 60)
$startTime = [DateTime]::UtcNow
if (-not $BuildNumber) {
$BuildNumber = Get-BuildNumber
}
Trace-Log "Build #$BuildNumber started at $startTime"
$BuildErrors = @()
Invoke-BuildStep 'Running tests' { Run-Tests } `
-ev +BuildErrors
Trace-Log ('-' * 60)
## Calculating Build time
$endTime = [DateTime]::UtcNow
Trace-Log "Build #$BuildNumber ended at $endTime"
Trace-Log "Time elapsed $(Format-ElapsedTime ($endTime - $startTime))"
Trace-Log ('=' * 60)
if ($BuildErrors) {
$ErrorLines = $BuildErrors | %{ ">>> $($_.Exception.Message)" }
Error-Log "Tests completed with $($BuildErrors.Count) error(s):`r`n$($ErrorLines -join "`r`n")" -Fatal
}
Write-Host ("`r`n" * 3)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/inlazy/NuGet.Server.git
git@gitee.com:inlazy/NuGet.Server.git
inlazy
NuGet.Server
NuGet.Server
master

搜索帮助