- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们正在使用 devops 构建我们的 .net 4.7.2 应用程序。作为其中的一部分,我们正在运行使用 nunit 框架和测试运行器的单元测试。
它已经运行了大约 18 个月,但在最后一天刚刚停止工作:(
它使用标准模板来运行测试,看起来像:
- task: VSTest@2
displayName: "Running tests"
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
但是,现在该步骤失败并显示以下日志:
NUnit Adapter 4.2.0.0: Test execution startedRunning all tests in D:\a\1\s\Configuration.Tests\bin\Release\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dllNUnit3TestExecutor discovered 0 of 0 NUnit test cases using Current Discovery mode, Explicit runRunning all tests in D:\a\1\s\Configuration.Tests\bin\Release\testcentric.engine.metadata.dllNUnit3TestExecutor discovered 0 of 0 NUnit test cases using Current Discovery mode, Explicit runRunning all tests in D:\a\1\s\Api.Tests\bin\Release\testcentric.engine.metadata.dllNUnit3TestExecutor discovered 0 of 0 NUnit test cases using Current Discovery mode, Explicit runRunning all tests in D:\a\1\s\CommunicationTests\bin\Release\testcentric.engine.metadata.dllNUnit3TestExecutor discovered 0 of 0 NUnit test cases using Current Discovery mode, Explicit runRunning all tests in D:\a\1\s\Domain.Tests\bin\Release\testcentric.engine.metadata.dllNUnit3TestExecutor discovered 0 of 0 NUnit test cases using Current Discovery mode, Explicit runRunning all tests in D:\a\1\s\packages\NUnit3TestAdapter.4.2.1\build\net35\testcentric.engine.metadata.dllNUnit3TestExecutor discovered 0 of 0 NUnit test cases using Current Discovery mode, Explicit runNUnit Adapter 4.2.0.0: Test execution completeNo test is available in D:\a\1\s\Configuration.Tests\bin\Release\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll D:\a\1\s\Configuration.Tests\bin\Release\testcentric.engine.metadata.dll D:\a\1\s\Api.Tests\bin\Release\testcentric.engine.metadata.dll D:\a\1\s\CommunicationTests\bin\Release\testcentric.engine.metadata.dll D:\a\1\s\Domain.Tests\bin\Release\testcentric.engine.metadata.dll D:\a\1\s\packages\NUnit3TestAdapter.4.2.1\build\net35\testcentric.engine.metadata.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.##[error]Could not find testhostResults File: D:\a_temp\TestResults\VssAdministrator_WIN-FVJ4KUK6IFI_2022-08-18_12_38_44.trx##[error]Test Run Aborted.Total tests: UnknownPassed: 110Total time: 16.7203 SecondsVstest.console.exe exited with code 1.**************** Completed test execution *********************Test results files: D:\a_temp\TestResults\VssAdministrator_WIN-FVJ4KUK6IFI_2022-08-18_12_38_44.trxCreated test run: 1080Publishing test results: 112Publishing test results to test run '1080'.TestResults To Publish 112, Test run id:1080Test results publishing 112, remaining: 0. Test run id: 1080Published test results: 112Publishing Attachments: 1Execution Result Code 1 is non zero, checking for failed resultsCompleted TestExecution Model...##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.##[error]Error: The process 'D:\a_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.205.0\Modules\DTAExecutionHost.exe' failed with exit code 1##[error]Vstest failed with error. Check logs for failures. There might be failed tests.Finishing: Running tests
查看这个日志,似乎nunit测试已经成功运行,但它可能正在尝试运行mstests?当 devops 获得更新并破坏工作管道时,这令人沮丧。
最佳答案
我们也有类似的情况。
单元测试使用 xUnit 运行。
/TestAdapterPath:"D:\a\1\s" Starting test execution, please wait... Atotal of 36 test files matched the specified pattern.2.4828
##[error]Could not find testhost
Data collector 'Code Coverage' message: No code coverage dataavailable. Profiler was not initialized..2.0273
##[error]Could not find testhost
Data collector 'Code Coverage' message: No code coverage dataavailable. Profiler was not initialized..2.3746
##[error]Could not find testhost
Data collector 'Code Coverage' message: No code coverage dataavailable. Profiler was not initialized..1.992
##[error]Could not find testhost
Data collector 'Code Coverage' message: No code coverage dataavailable. Profiler was not initialized..4.8409##[error]Could not find testhost
Data collector 'Code Coverage' message: No code coverage dataavailable. Profiler was not initialized..2.1874##[error]Could not find testhost
我比较了成功运行和失败运行的输出,发现测试平台的版本不同。如果您不指定版本,则默认版本将是最新版本,并且可能是预览版本。所以我在 YAML 中添加了一些东西来指定一个可行的版本。
- task: VisualStudioTestPlatformInstaller@1
inputs:
versionSelector: 'SpecificVersion'
testPlatformVersion: '17.2.0'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
codeCoverageEnabled: True
vsTestVersion: 'toolsInstaller'
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/test/vstest?view=azure-devops https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/vstest-platform-tool-installer?view=azure-devops
关于azure-devops - 开发运维VSTest@2 : ##[error]Could not find testhost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73404846/
我有一个简单的 dotnet 核心类库,带有单个 XUnit 测试方法: TestLib.csproj: netstandard2.0
我已经为这个问题苦苦挣扎了好几个小时。我的 WebAPI 应用程序在本地机器和生产服务器上运行良好,但在具有依赖注入(inject)的 Controller 的集成测试期间失败。一切看起来都很干净,我
在 .net core api 中启用证书身份验证会导致 TestServer 在集成测试中始终返回 403-Forbidden(尽管请求中使用了证书)。 我尝试更改 TestClientProvid
我们正在使用 devops 构建我们的 .net 4.7.2 应用程序。作为其中的一部分,我们正在运行使用 nunit 框架和测试运行器的单元测试。 它已经运行了大约 18 个月,但在最后一天刚刚停止
我的 azure devops 测试管道遇到了一些麻烦。 我正在使用 xunit 测试,每个测试项目都正确运行,我可以查看测试结果,但由于以下错误,管道无论如何都失败了 ##[error]Testho
我已经按照 this 在 .net 核心中构建了一个 WebSocket Web 应用程序和 this或 this教程。现在我正在尝试使用 Microsoft.AspNetCore.TestHost
我有 ASP.Net MVC 应用程序,其中一部分是将 razor View 编译为字符串。该代码与此示例非常相似: https://long2know.com/2017/08/rendering-a
尝试在 VS2015 中测试 ASPNET 5 应用程序。 { "version": "1.0.0-*", "description": "HoldingTank Class Library"
我正在尝试为我使用 graphql-dotnet 的小型 GraphQL 服务器编写集成测试。当我使用我的 Web 应用程序时,服务器工作正常。 为了运行集成测试,我尝试使用 Microsoft.As
我有一个 C#(selenium + NUnit + Specflow).Net Core 2.1 项目(对比 2017)。 我的项目引用了包含 testhost.dll 的 Microsoft.Te
我使用 NUnit 创建了一个 selenium 测试框架,有一个测试来打开页面并断言页面标题。 但是,当我尝试运行测试时,它似乎开始和停止,甚至在使用 Debug 运行时也不做任何事情。测试保留在
我正在 azure devops 代理上运行一些 API 测试并收到此警告错误消息 2021-05-21T13:42:29.0650201Z ##[error]DiscoveryMessage :
我正在 azure devops 代理上运行一些 API 测试并收到此警告错误消息 2021-05-21T13:42:29.0650201Z ##[error]DiscoveryMessage :
我正在使用 SoapCore 使用 asp.net core 2 创建类似 WCF 的应用程序。 这对我来说很好用,但在集成测试我的端点时,我有点碰壁了。 由于 SoapCore 是一个中间件并且与任
我有一个 ASP.Net Core 应用程序,配置为颁发和验证 JWT 不记名 token 。当网站托管在 Kestrel 中时,客户端能够成功检索不记名 token 并使用该 token 进行身份验
如何在 ASP.NET MVC 6 中设置 View 引擎以与 TestServer 创建的测试主机一起工作。我已经尝试实现 trick来自 MVC 6 repo : [Fact] public as
我已经使用过几次这个包Microsoft.AspNetCore.TestHost在我的集成测试中托管 Asp.Net Core Web API 应用程序。 使用 Asp.Net Core 2.1 包
我了解 AspNetCore 2.1 仍处于候选发布形式,并且使用 Microsoft.AspNetCore.Mvc.Testing 的新测试模型不稳定。 但我正在尝试遵循示例并使用 WebAppli
没有简单的方法来访问 response 对象中的 CookieContainer 运行与 AspNet.TestHost.TestServer 的集成测试。 Cookie 必须由 Controller
大家好,在使用 Visual Studio 2008 (Cassini) 在内置 Web 服务器上本地测试 ASP.NET 应用程序时,我似乎发现了一个差异。 我在本地机器上设置了一个主机,将 dev
我是一名优秀的程序员,十分优秀!