diff --git a/appveyor.test.ps1 b/appveyor.test.ps1 index db415d0d..2937f058 100644 --- a/appveyor.test.ps1 +++ b/appveyor.test.ps1 @@ -1,28 +1,28 @@ function installDB() { write-host "init sqlserver database..." -ForegroundColor Cyan $startPath = "$($env:appveyor_build_folder)\db\SqlServer" - $sqlInstance = "(local)\SQL2014" + $sqlInstance = "(local)\SQL2017" $outFile = join-path $startPath "output.log" $sqlFile = join-path $startPath "Install.sql" $initFile = join-path $startPath "InitData.sql" sqlcmd -S "$sqlInstance" -U sa -P Password12! -i "$sqlFile" -i "$initFile" -o "$outFile" - write-host "init mysql database..." -ForegroundColor Cyan - $env:MYSQL_PWD="Password12!" - $mysql = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"' - $cmd = $mysql + ' -e "create database BootstrapAdmin;" -uroot' - cmd.exe /c $cmd + #write-host "init mysql database..." -ForegroundColor Cyan + #$env:MYSQL_PWD="Password12!" + #$mysql = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"' + #$cmd = $mysql + ' -e "create database BootstrapAdmin;" -uroot' + #cmd.exe /c $cmd - $startPath = "$($env:appveyor_build_folder)\db\MySQL" - $para = ' -hlocalhost -uroot -DBootstrapAdmin < ' - $sqlFile = join-path $startPath "Install.sql" - $cmd = $mysql + $para + $sqlFile - cmd.exe /c $cmd + #$startPath = "$($env:appveyor_build_folder)\db\MySQL" + #$para = ' -hlocalhost -uroot -DBootstrapAdmin < ' + #$sqlFile = join-path $startPath "Install.sql" + #$cmd = $mysql + $para + $sqlFile + #cmd.exe /c $cmd - $initFile = join-path $startPath "InitData.sql" - $cmd = $mysql + $para + $initFile - cmd.exe /c $cmd + #$initFile = join-path $startPath "InitData.sql" + #$cmd = $mysql + $para + $initFile + #cmd.exe /c $cmd write-host "init mongodb data..." -ForegroundColor Cyan $initFolder = "$($env:appveyor_build_folder)\db\MongoDB" @@ -38,7 +38,7 @@ function runUnitTest() { write-host "dotnet test test\UnitTest" -ForegroundColor Cyan - dotnet test test\UnitTest /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap*]*" /p:ExcludeByFile="..\..\src\admin\Bootstrap.Admin\Program.cs%2c..\..\src\admin\Bootstrap.Admin\Startup.cs%2c..\..\src\admin\Bootstrap.Admin\HttpHeaderOperation.cs" /p:CoverletOutput=..\..\ + dotnet test test\UnitTest --filter FullyQualifiedName!~MySql /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap*]*" /p:ExcludeByFile="..\..\src\admin\Bootstrap.Admin\Program.cs%2c..\..\src\admin\Bootstrap.Admin\Startup.cs%2c..\..\src\admin\Bootstrap.Admin\HttpHeaderOperation.cs" /p:CoverletOutput=..\..\ } function coverallUnitTest() { @@ -67,6 +67,9 @@ function codecovUnitTest() { cmd.exe /c "$codecovCmd -f ""coverage.opencover.xml""" } -installDB -coverallUnitTest -codecovUnitTest \ No newline at end of file +$branch = $($env:APPVEYOR_REPO_BRANCH) +if ($branch -ne "dev") { + installDB + coverallUnitTest + codecovUnitTest +} diff --git a/appveyor.yml b/appveyor.yml index 60b317a3..4c47dee9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,10 @@ version: 1.0.{build} branches: only: + - release - master -image: Visual Studio 2017 + - dev +image: Visual Studio 2019 clone_depth: 1 init: - ps: git version @@ -18,16 +20,11 @@ environment: secure: +22PuAn5seq4bbCVCly8zDFuyEV3m2NjW3QuM0+2gm4c8akwicNFmv2T/ZGd0Jpd cache: C:\ProgramData\chocolatey\lib\codecov\tools services: -- mssql2014 -- mysql +- mssql2017 - mongodb install: - ps: >- - #copy my.ini into mysql folder - dotnet --version - - xcopy "$($env:appveyor_build_folder)\db\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y build_script: - ps: >- .\appveyor.build.ps1