test: 更正单元测试推送脚本

This commit is contained in:
Argo Zhang 2020-02-12 23:08:07 +08:00
parent 6321500dd7
commit 78f41e4aa0
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
3 changed files with 15 additions and 19 deletions

View File

@ -6,7 +6,7 @@
##### Version & Coverage
[![Release](https://img.shields.io/endpoint.svg?logo=Groupon&logoColor=red&color=green&label=release&url=https://ba.sdgxgz.com/api/Gitee/Releases)](https://gitee.com/LongbowEnterprise/BootstrapAdmin/releases)
[![Coveralls](https://img.shields.io/coveralls/github/ArgoZhang/BootstrapAdmin/master.svg?logo=ReverbNation&logoColor=green&label=coveralls)](https://coveralls.io/github/ArgoZhang/BootstrapAdmin)
[![Coveralls](https://img.shields.io/coveralls/github/ArgoZhang/BootstrapAdmin/master.svg?logo=ReverbNation&logoColor=green&label=coveralls)](https://coveralls.io/github/ArgoZhang/BootstrapAdmin?branch=master)
[![Codecov](https://img.shields.io/codecov/c/gh/argozhang/bootstrapadmin/master.svg?logo=codecov&label=codecov)](https://codecov.io/gh/argozhang/bootstrapadmin/branch/master)
##### Gitee

View File

@ -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

View File

@ -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