Appveyor build improvements:
- added nuget packages folder to cache to speedup build
- all unit tests are now showing up in the tests tab
This commit is contained in:
Luigi Grilli 2016-06-12 08:55:09 +01:00
Родитель dd3464baf7
Коммит ff298d0811
2 изменённых файлов: 44 добавлений и 5 удалений

Просмотреть файл

@ -17,6 +17,8 @@ skip_tags: true
#---------------------------------#
# environment configuration #
#---------------------------------#
cache:
- packages
# scripts that are called at very beginning, before repo cloning
init:
@ -62,14 +64,14 @@ after_build:
#---------------------------------#
# tests configuration #
#---------------------------------#
before_test:
- dotnet test .\BenchmarkDotNet.Tests\project.json --configuration Release
- dotnet test .\BenchmarkDotNet.IntegrationTests\project.json --configuration Release
test_script:
- dotnet test .\BenchmarkDotNet.Tests\project.json --configuration Release -xml tests-results01.xml
- ps: .\build\uploadtests.ps1 "tests-results01.xml"
- dotnet test .\BenchmarkDotNet.IntegrationTests\project.json --configuration Release -xml tests-results02.xml
- ps: .\build\uploadtests.ps1 "tests-results02.xml"
test:
assemblies:
- BenchmarkDotNet.Tests\bin\$(configuration)\net451\win7-x64\BenchmarkDotNet.Tests.dll
- BenchmarkDotNet.IntegrationTests\bin\$(configuration)\net451\win7-x64\BenchmarkDotNet.IntegrationTests.dll
- BenchmarkDotNet.IntegrationTests.Classic\bin\$(configuration)\BenchmarkDotNet.IntegrationTests.Classic.exe
artifacts:

37
build/uploadtests.ps1 Normal file
Просмотреть файл

@ -0,0 +1,37 @@
param(
[string]
$ResultsFile,
[string]
$ResultsType = "xunit"
)
$ResultsFile = Resolve-Path $ResultsFile
$Url = "https://ci.appveyor.com/api/testresults/$ResultsType/$($env:APPVEYOR_JOB_ID)"
if(-Not (Test-Path $ResultsFile))
{
Write-Host "File '$ResultsFile' not found"
exit(1)
}
# upload results to AppVeyor
try
{
$wc = New-Object 'System.Net.WebClient'
$wc.UploadFile($Url, $ResultsFile)
Write-Host "Tests result uploaded correctly"
}
catch
{
Write-Host "Error uploading tests results to $Url"
$Exception = $_.Exception
while($null -ne $Exception)
{
Write-Host "Error: $($Exception.Message)"
$Exception = $Exception.InnerException
}
exit(2)
}