gpt4 book ai didi

.net - 为什么我使用 localdb 进行的测试在 Azure DevOps 中运行良好?

转载 作者:行者123 更新时间:2023-12-05 03:42:19 27 4
gpt4 key购买 nike

我使用 Azure DevOps 来执行 .NET Core 应用程序的 CI 流程。我还使用基于 localDb SQL 数据库的集成测试。当我运行 ci piplene 时,我惊讶地发现所有测试都通过了。

{
"UseInMemoryDatabase": false, // Application.IntegrationTests are not designed to work with InMemory database.
"DeveloperPathSqlConnectionString": "Server=(localdb)\\mssqllocaldb;Database=DeveloperPathTestDb;Trusted_Connection=True;MultipleActiveResultSets=true;",
"Key": {
"Type": "Development"
},
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}

Azure DevOps 是否已包含 localdb?

最佳答案

Does Azure DevOps already contain the localdb?

答案是肯定的。

Windows 镜像包含 localdb。 hosted windows agent附带包含 LocalDB 的 Visual Studio。

您可以使用以下启动命令来验证:

pool:
vmImage: 'windows-latest'


- task: PowerShell@2
displayName: 'start mssqllocaldb'
inputs:
targetType: 'inline'
script: 'sqllocaldb start mssqllocaldb'

测试结果:

enter image description here

关于.net - 为什么我使用 localdb 进行的测试在 Azure DevOps 中运行良好?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67339383/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com