test: 更正单元测试推送脚本
This commit is contained in:
parent
6321500dd7
commit
78f41e4aa0
|
@ -6,7 +6,7 @@
|
|||
|
||||
##### Version & Coverage
|
||||
[](https://gitee.com/LongbowEnterprise/BootstrapAdmin/releases)
|
||||
[](https://coveralls.io/github/ArgoZhang/BootstrapAdmin)
|
||||
[](https://coveralls.io/github/ArgoZhang/BootstrapAdmin?branch=master)
|
||||
[](https://codecov.io/gh/argozhang/bootstrapadmin/branch/master)
|
||||
|
||||
##### Gitee
|
||||
|
|
|
@ -38,36 +38,33 @@
|
|||
|
||||
function runUnitTest() {
|
||||
write-host "dotnet test test\UnitTest" -ForegroundColor Cyan
|
||||
dotnet test "test\UnitTest" --filter="FullyQualifiedName!~MySql" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap.Admin*]*%2c[Bootstrap.DataAccess*]*" /p:Exclude="[*]*Program%2c[*]*Startup%2c[Bootstrap.DataAccess*]*AutoDB*%2c[Bootstrap.DataAccess]*WeChatHelper" /p:ExcludeByFile="**/SMSExtensions.cs%2c**/Helper/OAuthHelper.cs%2c**/Extensions/CloudLoggerExtensions.cs%2c**/Extensions/AutoGenerateDatabaseExtensions.cs%2c**/Api/HealthsController.cs%2c**/Pages/**%2c**/DBLogTask.cs" /p:CoverletOutput=..\..\
|
||||
dotnet test "test\UnitTest" --filter="FullyQualifiedName!~MySql" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap.Admin*]*%2c[Bootstrap.DataAccess*]*" /p:Exclude="[*]*Program%2c[*]*Startup%2c[Bootstrap.DataAccess*]*AutoDB*%2c[Bootstrap.DataAccess]*WeChatHelper" /p:ExcludeByFile="**/SMSExtensions.cs%2c**/Helper/OAuthHelper.cs%2c**/Extensions/CloudLoggerExtensions.cs%2c**/Extensions/AutoGenerateDatabaseExtensions.cs%2c**/Api/HealthsController.cs%2c**/Pages/**%2c**/DBLogTask.cs%2c**/AutoDbHelper.cs" /p:CoverletOutput=..\..\
|
||||
}
|
||||
|
||||
function installCoveralls() {
|
||||
write-host "install coveralls.net tools" -ForegroundColor Cyan
|
||||
dotnet tool install coveralls.net --version 1.0.0 --tool-path ".\tools"
|
||||
dotnet tool install coveralls.net --tool-path ".\tools"
|
||||
}
|
||||
|
||||
function reportCoveralls() {
|
||||
write-host "report UnitTest with Coveralls" -ForegroundColor Cyan
|
||||
cmd.exe /c ".\tools\csmacnz.Coveralls.exe --opencover -i coverage.opencover.xml --useRelativePaths"
|
||||
}
|
||||
|
||||
function installCodecov() {
|
||||
Set-AppveyorBuildVariable COVERALLS_REPO_TOKEN $($env:COVERALLS_REPO_TOKEN)
|
||||
Set-AppveyorBuildVariable CODECOV_TOKEN $($env:CODECOV_TOKEN)
|
||||
|
||||
$codecovCmd = "C:\ProgramData\chocolatey\lib\codecov\tools\codecov.exe"
|
||||
$codecov = Test-Path $codecovCmd
|
||||
if (!$codecov) {
|
||||
write-host "install codecov tools" -ForegroundColor Cyan
|
||||
choco install codecov
|
||||
}
|
||||
write-host "report UnitTest with Coveralls" -ForegroundColor Cyan
|
||||
.\tools\csmacnz.Coveralls.exe --opencover -i coverage.opencover.xml --useRelativePaths
|
||||
}
|
||||
|
||||
function reportCodecov() {
|
||||
Set-AppveyorBuildVariable CODECOV_TOKEN $($env:CODECOV_TOKEN)
|
||||
Set-AppveyorBuildVariable CI $($env:CI)
|
||||
Set-AppveyorBuildVariable APPVEYOR $($env:Appveyor)
|
||||
|
||||
$coverageFile = Test-Path coverage.opencover.xml
|
||||
if (!$coverageFile) {
|
||||
if ($coverageFile) {
|
||||
write-host "install Codecov.Tool tools" -ForegroundColor Cyan
|
||||
dotnet tool install Codecov.Tool --tool-path ".\tools"
|
||||
|
||||
write-host "report UnitTest with Codecov" -ForegroundColor Cyan
|
||||
cmd.exe /c "$codecovCmd -f ""coverage.opencover.xml"""
|
||||
.\tools\codecov -f coverage.opencover.xml
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +72,6 @@ $branch = $($env:APPVEYOR_REPO_BRANCH)
|
|||
if ($branch -ne "dev") {
|
||||
installDB
|
||||
installCoveralls
|
||||
installCodecov
|
||||
runUnitTest
|
||||
reportCoveralls
|
||||
reportCodecov
|
||||
|
|
|
@ -9,6 +9,7 @@ clone_depth: 1
|
|||
init:
|
||||
- ps: git version
|
||||
environment:
|
||||
CI: true
|
||||
Appveyor: true
|
||||
COVERALLS_REPO_TOKEN:
|
||||
secure: 5L1b6XqSNTOfU1iZrARo5eUOi1HOleVO3VDCW0pr6yaspgkC5jxL+gBDK0OEY8EI
|
||||
|
@ -18,7 +19,6 @@ environment:
|
|||
secure: 6rKKLXCmy3HZBxW5SjoO4Ox7G09FC0NJgGnvukWkYyJ2rx1GCzu4JvmLin69SHRz
|
||||
CODECOV_TOKEN_GITLAB:
|
||||
secure: +22PuAn5seq4bbCVCly8zDFuyEV3m2NjW3QuM0+2gm4c8akwicNFmv2T/ZGd0Jpd
|
||||
cache: C:\ProgramData\chocolatey\lib\codecov\tools
|
||||
services:
|
||||
- mssql2017
|
||||
- mongodb
|
||||
|
|
Loading…
Reference in New Issue