1 Star 0 Fork 0

四个石头 / mRemoteNG

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Jenkinsfile 2.29 KB
一键复制 编辑 原始数据 按行查看 历史
#!groovy
node('windows') {
def jobDir = pwd()
def solutionFilePath = "\"${jobDir}\\mRemoteV1.sln\""
def msBuild = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\MSBuild\\15.0\\Bin\\msbuild.exe"
def nunitConsolePath = "${jobDir}\\packages\\NUnit.ConsoleRunner.3.7.0\\tools\\nunit3-console.exe"
def openCoverPath = "${jobDir}\\packages\\OpenCover.4.6.519\\tools\\OpenCover.Console.exe"
def reportGeneratorPath = "${jobDir}\\packages\\ReportGenerator.3.0.2\\tools\\ReportGenerator.exe"
def testResultFilePrefix = "TestResult"
def testResultFileNormal = "${testResultFilePrefix}_UnitTests_normal.xml"
def testResultFilePortable = "${testResultFilePrefix}_UnitTests_portable.xml"
def testResultFileAcceptance = "${testResultFilePrefix}_AcceptanceTests.xml"
def coverageReport = "code_coverage_report.xml"
def codeCoverageHtml = "CodeCoverageReport.html"
stage ('Checkout Branch') {
checkout scm
bat "del /Q \"${jobDir}\\${testResultFilePrefix}*.xml\""
}
stage ('Restore NuGet Packages') {
def nugetPath = "C:\\nuget.exe"
bat "${nugetPath} restore ${solutionFilePath}"
}
stage ('Build mRemoteNG (Normal)') {
bat "\"${msBuild}\" /nologo /p:Platform=x86 \"${jobDir}\\mRemoteV1.sln\""
}
stage ('Build mRemoteNG (Portable)') {
bat "\"${msBuild}\" /nologo /p:Configuration=\"Debug Portable\";Platform=x86 \"${jobDir}\\mRemoteV1.sln\""
}
stage ('Run Unit Tests (Normal, w/coverage)') {
try {
bat "\"${openCoverPath}\" -register:user -target:\"${nunitConsolePath}\" -targetargs:\"\"${jobDir}\\mRemoteNGTests\\bin\\debug\\mRemoteNGTests.dll\" --result=${testResultFileNormal} --x86\" -output:\"${coverageReport}\""
}
catch (ex) {
nunit testResultsPattern: "${testResultFilePrefix}*.xml"
throw ex
}
}
stage ('Run Unit Tests (Portable)') {
try {
bat "\"${nunitConsolePath}\" \"${jobDir}\\mRemoteNGTests\\bin\\debug portable\\mRemoteNGTests.dll\" --result=${testResultFilePortable} --x86"
}
catch (ex) {
nunit testResultsPattern: "${testResultFilePrefix}*.xml"
throw ex
}
}
stage ('Run Acceptance Tests') {
try {
bat "\"${nunitConsolePath}\" \"${jobDir}\\mRemoteNG.Specs\\bin\\debug\\mRemoteNG.Specs.dll\" --result=${testResultFileAcceptance} --x86"
}
catch (ex) {
nunit testResultsPattern: "${testResultFilePrefix}*.xml"
throw ex
}
}
}
1
https://gitee.com/sigeshitou1987/mRemoteNG.git
git@gitee.com:sigeshitou1987/mRemoteNG.git
sigeshitou1987
mRemoteNG
mRemoteNG
master

搜索帮助