Browse Source

breaking down test execution into multiple AppVeyor jobs

af/merge-core
Anton Firszov 8 years ago
parent
commit
ca5a0ceeec
  1. 24
      appveyor.yml
  2. 16
      build.ps1
  3. 40
      run-tests.ps1

24
appveyor.yml

@ -4,6 +4,25 @@ image: Visual Studio 2017
# prevent the double build when a branch has an active PR
skip_branch_with_pr: true
environment:
matrix:
- target_framework: netcoreapp2.0
is_32bit: False
- target_framework: netcoreapp2.0
is_32bit: True
- target_framework: net462
is_32bit: False
- target_framework: net462
is_32bit: True
- target_framework: net47
is_32bit: False
- target_framework: net47
is_32bit: True
- target_framework: net471
is_32bit: False
- target_framework: net471
is_32bit: True
before_build:
- git submodule -q update --init
- cmd: dotnet --version
@ -12,10 +31,7 @@ build_script:
- cmd: build.cmd
test_script:
- tests\CodeCoverage\CodeCoverage.cmd
- cmd: cd .\tests\ImageSharp.Tests
- .\RunExtendedTests.cmd
- ps: .\run-tests.ps1 $env:target_framework $env:is_32bit
after_test:
- cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.%APPVEYOR_BUILD_VERSION%.nupkg"

16
build.ps1

@ -100,12 +100,16 @@ dotnet build -c Release /p:packageversion=$version
if ($LASTEXITCODE ){ Exit $LASTEXITCODE }
if ( $env:CI -ne "True") {
cd ./tests/ImageSharp.Tests/
dotnet xunit -nobuild -c Release -f netcoreapp2.0 --fx-version 2.0.0
./RunExtendedTests.cmd
cd ../..
}
#
# TODO: DO WE NEED TO RUN TESTS IMPLICITLY?
#
# if ( $env:CI -ne "True") {
# cd ./tests/ImageSharp.Tests/
# dotnet xunit -nobuild -c Release -f netcoreapp2.0 --fx-version 2.0.0
# ./RunExtendedTests.cmd
# cd ../..
# }
#
if ($LASTEXITCODE ){ Exit $LASTEXITCODE }

40
run-tests.ps1

@ -0,0 +1,40 @@
param(
[string]$targetFramework,
[string]$is32Bit = "False"
)
if (!$targetFramework){
Write-Host "run-tests.ps1 ERROR: targetFramework is undefined!"
exit 1
}
if ( ($targetFramework -eq "netcoreapp2.0") -and ($env:CI -eq "True") -and ($is32Bit -ne "True")) {
# We execute CodeCoverage.cmd only for one specific job on CI (netcoreapp2.0 + 64bit )
$testRunnerCmd = ".\tests\CodeCoverage\CodeCoverage.cmd"
}
elseif ($targetFramework -eq "mono") {
$testRunnerCmd = "Write-Host '**** placeholder for mono test execution ****'"
}
else {
cd .\tests\ImageSharp.Tests
$xunitArgs = "-c Release -framework $targetFramework"
if ($targetFramework -eq "netcoreapp2.0") {
# There are issues matching the correct installed runtime if we do not specify it explicitly:
$xunitArgs += " --fx-version 2.0.0"
}
if ($is32Bit -eq "True") {
$xunitArgs += " -x86"
}
$testRunnerCmd = "dotnet xunit $xunitArgs"
}
Write-Host "running:"
Write-Host $testRunnerCmd
Write-Host "..."
Invoke-Expression $testRunnerCmd
cd $PSScriptRoot
Loading…
Cancel
Save