|
|
@@ -2,9 +2,8 @@ $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
|
|
|
|
|
|
$configuration = "Release"
|
|
|
|
|
|
-$isAppVeyor = Test-Path -Path env:\APPVEYOR
|
|
|
+$isCloudBuild = Test-Path -Path env:\TF_BUILD
|
|
|
$outputLocation = Join-Path $scriptPath "testResults"
|
|
|
-$xUnitConsolePath = ".\packages\xunit.runner.console\tools\net452\xunit.console.exe"
|
|
|
$rootPath = (Resolve-Path .).Path
|
|
|
$artifacts = Join-Path $rootPath "artifacts"
|
|
|
|
|
|
@@ -30,8 +29,7 @@ if (!(Test-Path .\nuget.exe)) {
|
|
|
# get tools
|
|
|
.\nuget.exe install -excludeversion SignClient -Version 0.9.0 -outputdirectory packages
|
|
|
.\nuget.exe install -excludeversion JetBrains.dotCover.CommandLineTools -pre -outputdirectory packages
|
|
|
-.\nuget.exe install -excludeversion Nerdbank.GitVersioning -Version 2.0.41 -outputdirectory packages
|
|
|
-.\nuget.exe install -excludeversion xunit.runner.console -outputdirectory packages
|
|
|
+.\nuget.exe install -excludeversion Nerdbank.GitVersioning -Version 2.1.23 -outputdirectory packages
|
|
|
.\nuget.exe install -excludeversion ReportGenerator -outputdirectory packages
|
|
|
#.\nuget.exe install -excludeversion coveralls.io -outputdirectory packages
|
|
|
.\nuget.exe install -excludeversion coveralls.io.dotcover -outputdirectory packages
|
|
|
@@ -45,13 +43,6 @@ Write-Host "Building $packageSemVer" -Foreground Green
|
|
|
New-Item -ItemType Directory -Force -Path $artifacts
|
|
|
|
|
|
|
|
|
-Write-Host "Restoring packages for $scriptPath\Ix.NET.sln" -Foreground Green
|
|
|
-# use nuget.exe to restore on the legacy proj type
|
|
|
-#.\nuget.exe restore "$scriptPath\System.Interactive.Tests.Uwp.DeviceRunner\System.Interactive.Tests.Uwp.DeviceRunner.csproj"
|
|
|
-dotnet restore "$scriptPath\Ix.NET.sln"
|
|
|
-# Force a restore again to get proper version numbers https://github.com/NuGet/Home/issues/4337
|
|
|
-dotnet restore "$scriptPath\Ix.NET.sln"
|
|
|
-
|
|
|
Write-Host "Building $scriptPath\Ix.NET.sln" -Foreground Green
|
|
|
|
|
|
# Using MSBuild here since th UWP test project cannot be built by the dotnet CLI
|
|
|
@@ -62,7 +53,7 @@ Write-Host "Building Packages" -Foreground Green
|
|
|
dotnet pack "$scriptPath\System.Interactive\System.Interactive.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
Write-Host "Error with build" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
+ if($isCloudBuild) {
|
|
|
$host.SetShouldExit($LastExitCode)
|
|
|
exit $LastExitCode
|
|
|
}
|
|
|
@@ -71,7 +62,7 @@ if ($LastExitCode -ne 0) {
|
|
|
dotnet pack "$scriptPath\System.Interactive.Async\System.Interactive.Async.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
Write-Host "Error with build" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
+ if($isCloudBuild) {
|
|
|
$host.SetShouldExit($LastExitCode)
|
|
|
exit $LastExitCode
|
|
|
}
|
|
|
@@ -80,7 +71,7 @@ if ($LastExitCode -ne 0) {
|
|
|
dotnet pack "$scriptPath\System.Interactive.Async.Providers\System.Interactive.Async.Providers.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
Write-Host "Error with build" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
+ if($isCloudBuild) {
|
|
|
$host.SetShouldExit($LastExitCode)
|
|
|
exit $LastExitCode
|
|
|
}
|
|
|
@@ -89,7 +80,7 @@ if ($LastExitCode -ne 0) {
|
|
|
dotnet pack "$scriptPath\System.Interactive.Providers\System.Interactive.Providers.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
Write-Host "Error with build" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
+ if($isCloudBuild) {
|
|
|
$host.SetShouldExit($LastExitCode)
|
|
|
exit $LastExitCode
|
|
|
}
|
|
|
@@ -106,7 +97,7 @@ if($hasSignClientSecret) {
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
Write-Host "Error signing $nupkg" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
+ if($isCloudBuild) {
|
|
|
$host.SetShouldExit($LastExitCode)
|
|
|
exit $LastExitCode
|
|
|
}
|
|
|
@@ -123,24 +114,23 @@ $testDirectory = Join-Path $scriptPath "System.Interactive.Tests"
|
|
|
|
|
|
# OpenCover isn't working currently. So run tests on CI and coverage with JetBrains
|
|
|
|
|
|
-# Use xUnit CLI as it's significantly faster than vstest (dotnet test)
|
|
|
$dotnet = "$env:ProgramFiles\dotnet\dotnet.exe"
|
|
|
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFileDotCover1"
|
|
|
+.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="test -c $configuration --filter `"SkipCI!=true`"" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFileDotCover1"
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
Write-Host "Error with tests" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
+ if($isCloudBuild) {
|
|
|
$host.SetShouldExit($LastExitCode)
|
|
|
exit $LastExitCode
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$testDirectory = Join-Path $scriptPath "System.Interactive.Async.Tests"
|
|
|
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFileDotCover2"
|
|
|
+.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="test -c $configuration --filter `"SkipCI!=true`"" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFileDotCover2"
|
|
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
|
Write-Host "Error with tests" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
+ if($isCloudBuild) {
|
|
|
$host.SetShouldExit($LastExitCode)
|
|
|
exit $LastExitCode
|
|
|
}
|
|
|
@@ -150,7 +140,7 @@ if ($LastExitCode -ne 0) {
|
|
|
.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe report /Source="$outputFileDotCover" /Output="$outputFile" /ReportType=DetailedXML /HideAutoProperties
|
|
|
|
|
|
# Either display or publish the results
|
|
|
-if ($env:CI -eq 'True')
|
|
|
+if ($isCloudBuild -eq 'True')
|
|
|
{
|
|
|
.\packages\coveralls.io.dotcover\tools\coveralls.net.exe -p DotCover "$outputFile"
|
|
|
}
|