【发布时间】:2020-01-29 16:00:04
【问题描述】:
我无法让我的 gtest 在我的构建管道中运行。我的解决方案非常适合在 Visual Studio 2017 中构建和运行测试用例。在 DevOps 环境中,我使用 .Net 桌面设置并稍作修改。构建任务在管道中也可以正常工作。
我尝试使用默认的 VSTest 任务,但我不确定它是否适合运行使用 VS IDE 中的 Visual Studio 项目创建的 Google 测试。
构建管道 yml 脚本
# .NET Desktop
trigger:
- master
# Install build environment
pool:
vmImage: 'windows-latest'
name: Hosted VS2017
variables:
solution: '**/*.sln'
buildPlatform: 'x86'
buildConfiguration: 'Debug'
steps:
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
# Build VS solutions including gtest project.
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
# Run gTest, this task not working see log below.
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
VSTest 日志输出
Running tests using vstest.console.exe runner.
======================================================
Test selector : Test assemblies
Test filter criteria : null
Search folder : d:\a\1\s
VisualStudio version selected for test execution : latest
Attempting to find vstest.console from a visual studio installation with version [16.0,17.0).
Attempting to find vstest.console from a visual studio build tools installation with version [16.0,17.0).
Attempting to find vstest.console from a visual studio installation with version [15.0,16.0).
Run in parallel : false
Run in isolation : false
Path to custom adapters : null
Other console options : null
Code coverage enabled : false
Diagnostics enabled : false
SystemVssConnection exists true
Run the tests locally using vstest.console.exe
========================================================
##[warning]No test assemblies found matching the pattern: **\*test*.dll,!**\*TestAdapter.dll,!**\obj\**.
【问题讨论】:
标签: azure-devops visual-studio-2017 yaml azure-pipelines googletest