From 1d4467b10282e557b8b9cfa67ebf02279e4470e1 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 17 May 2019 07:17:59 +0800 Subject: [PATCH] build(Coveralls): add coveralls.io for UnitTest --- README.md | 1 + UnitTest/UnitTest.csproj | 2 ++ appveyor.yml | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3ef4c3c0..e1e1f925 100644 --- a/README.md +++ b/README.md @@ -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)** 的能力。 diff --git a/UnitTest/UnitTest.csproj b/UnitTest/UnitTest.csproj index 9c100e12..a811fba0 100644 --- a/UnitTest/UnitTest.csproj +++ b/UnitTest/UnitTest.csproj @@ -4,9 +4,11 @@ netcoreapp2.2 false true + full + diff --git a/appveyor.yml b/appveyor.yml index 0240bf9d..ef9caed5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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" }