build(Coveralls): add coveralls.io for UnitTest

This commit is contained in:
Argo Zhang 2019-05-17 07:17:59 +08:00
parent 366df54ffb
commit 1d4467b102
3 changed files with 16 additions and 3 deletions

View File

@ -12,6 +12,7 @@
[![Build status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin/dev.svg?label=dev)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/dev)
[![Build status](https://img.shields.io/appveyor/ci/ArgoZhang/bootstrapadmin/dev.svg?label=master)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/master)
[![Test Status](https://img.shields.io/appveyor/tests/argozhang/bootstrapadmin/master.svg)](https://ci.appveyor.com/project/ArgoZhang/bootstrapadmin/branch/master/tests)
[![Cover Status](https://img.shields.io/coveralls/github/ArgoZhang/BootstrapAdmin/master.svg)](https://coveralls.io/github/ArgoZhang/BootstrapAdmin)
## 项目介绍
一直需要一款后台管理系统,但是网上很多开源项目都是 **Java** 开发的,本人是 **NET** 平台的对 **Java** 一窍不通C#版本的本来就少而且还没有合适的。于是决定自己开发一套后台管理系统。由于前台采用 **Bootstrap** 布局样式,所以就叫做 **BootstrapAdmin** 。本系统可以用于所有的 Web 应用程序,目前版本已经升级到 **NET CORE** 具备跨平台能力。数据库方面同时支持多种数据库,详细列表见后面**数据库**的详细列表切换数据源仅需更改配置文件无需重启应用程序配置简单灵活。UI 前端使用流行的 Bootstrap 框架布局对移动设备的兼容性非常好,自适应目前市场几乎所有终端设备。本系统还具备单一后台支持多前台的特色,提供 **单点登录SSO** 的能力。

View File

@ -4,9 +4,11 @@
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />

View File

@ -10,6 +10,7 @@ init:
- ps: dotnet --version
environment:
Appveyor: true
COVERALLS_REPO_TOKEN: OSBtrE43PLtH6NFqk7XDZr9sZcdTYARZ4
services:
- mssql2014
- mysql
@ -34,7 +35,13 @@ test_script:
{
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~SQLite"
dotnet tool install coveralls.net --version 1.0.0 --tool-path "./tools"
echo "Start test for SQLite"
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~SQLite" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutputDirectory=../
cmd.exe /c ".\tools\csmacnz.Coveralls.exe --opencover -i coverage.xml --useRelativePaths"
$startPath = "$($env:appveyor_build_folder)\DatabaseScripts"
@ -52,6 +59,7 @@ test_script:
sqlcmd -S "$sqlInstance" -U sa -P Password12! -i "$sqlFile" -i "$initFile" -o "$outFile"
echo "Start test for SqlServer"
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~SqlServer"
@ -62,8 +70,6 @@ test_script:
$cmd = '"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" -e "create database BootstrapAdmin;" -uroot'
#iex "& $cmd"
cmd.exe /c $cmd
@ -81,6 +87,8 @@ test_script:
cmd.exe /c $cmd $initFile
echo "Start test for MySql"
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~MySql"
@ -102,6 +110,8 @@ test_script:
cd $($env:appveyor_build_folder)
echo "Start test for MongoDB"
dotnet test UnitTest --no-restore --filter "FullyQualifiedName~MongoDB"
}