diff --git a/appveyor.yml b/appveyor.yml index c2cd078201..9e17c95901 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,7 +24,7 @@ matrix: environment: COVERALLS_REPO_TOKEN: - secure: UQiSUNs39uWy45YG1iS9hatwF5ouX0Q2c + secure: 1hvfHFO3qtGTcwB+AnCGYsn0az0j9MzAux5hee5CFeyRJ+lWut0LjnyqvsI/5Pfa #---------------------------------# # build configuration # @@ -35,7 +35,6 @@ before_build: - ps: Import-Module .\build\psake.psm1 build_script: - - ps: Invoke-Psake .\build\build.ps1 -properties @{"BuildNumber"=$env:APPVEYOR_BUILD_NUMBER} #---------------------------------# # tests configuration # diff --git a/build/build.ps1 b/build/build.ps1 index 37c532ab56..f09c5b9c04 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -5,6 +5,7 @@ Properties { # see appveyor.yml for usage $BuildNumber = $null + $IsAppVeyor = $null # Input and output paths $BUILD_PATH = Resolve-Path "." @@ -23,7 +24,7 @@ Properties { $NUGET_EXE = Join-Path $SRC_PATH ".nuget\NuGet.exe" $NUNIT_EXE = Join-Path $SRC_PATH "packages\NUnit.Runners.2.6.3\tools\nunit-console.exe" $COVERALLS_EXE = Join-Path $SRC_PATH "packages\coveralls.io.1.3.2\tools\coveralls.net.exe" - $OPENCOVER_EXE = Join-Path $SRC_PATH "packages\OpenCover.4.5.3207\OpenCover.Console.exe" + $OPENCOVER_EXE = Join-Path $SRC_PATH "packages\OpenCover.4.5.3809-rc94\OpenCover.Console.exe" $REPORTGEN_EXE = Join-Path $SRC_PATH "packages\ReportGenerator.1.9.1.0\ReportGenerator.exe" $NUNITREPORT_EXE = Join-Path $BUILD_PATH "tools\NUnitHTMLReportGenerator.exe" @@ -152,15 +153,22 @@ task Run-Coverage -depends Build-Tests { $TestDdlPath = Join-Path $TestDllFolder "$_.dll" $CoverageOutputPath = Join-Path $TEST_RESULTS "$($_)_Coverage.xml" + $appVeyor = "" + if ($IsAppVeyor) { + $appVeyor = " -appveyor" + } + Write-Host "Running code coverage on project $_" $coverageFilter = "-filter:+[*]* -[FluentAssertions*]* -[ImageProcessor]*Common.Exceptions -[ImageProcessor.UnitTests]* -[ImageProcessor.Web.UnitTests]*" - & $OPENCOVER_EXE -register:user -target:$NUNIT_EXE -targetargs:"$TestDdlPath /noshadow /nologo" -targetdir:$TestDllFolder -output:$CoverageOutputPath $coverageFilter + & $OPENCOVER_EXE -threshold:1 -oldstyle -register:user -target:$NUNIT_EXE -targetargs:"$TestDdlPath /noshadow /nologo" $appVeyor -targetdir:$TestDllFolder -output:$CoverageOutputPath $coverageFilter Write-Host "Transforming coverage results file to HTML" - & $REPORTGEN_EXE -reports:$CoverageOutputPath -targetdir:(Join-Path $TEST_RESULTS "Coverage\$_") + & $REPORTGEN_EXE -verbosity:Info -reports:$CoverageOutputPath -targetdir:(Join-Path $TEST_RESULTS "Coverage\$_") - Write-Host "Uploading coverage report to Coveralls.io" - Exec { . $COVERALLS_EXE --opencover $CoverageOutputPath } + if ($env:COVERALLS_REPO_TOKEN -ne $null) { + Write-Host "Uploading coverage report to Coveralls.io" + Exec { . $COVERALLS_EXE --opencover $CoverageOutputPath } + } } } diff --git a/build/coverage.bat b/build/coverage.bat index 16cb3e6d6a..f27ef1d495 100644 --- a/build/coverage.bat +++ b/build/coverage.bat @@ -1,3 +1,5 @@ @echo off -powershell "Import-Module %~dp0\psake.psm1 ; Invoke-Psake %~dp0\build.ps1 Run-Coverage ; exit $LASTEXITCODE" \ No newline at end of file +powershell "Import-Module %~dp0\psake.psm1 ; Invoke-Psake %~dp0\build.ps1 Run-Coverage ; exit $LASTEXITCODE" + +pause \ No newline at end of file diff --git a/src/.nuget/packages.config b/src/.nuget/packages.config index 232098461c..aaa9ef5a04 100644 --- a/src/.nuget/packages.config +++ b/src/.nuget/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file