首页 > 解决方案 > 如何使用 YAML 配置文件在 VSTS 中的 VS2017 代理中启动 Azure 存储模拟器

问题描述

在我的 azure-pipelines.yml 文件中,我有这个任务:

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

在我的集成测试中,我同时使用了 MSQLLocalDB(似乎工作正常)和 AzureStorageEmulator(没有)。

我想试试这个答案

如何添加这些命令:

sqllocaldb create MSSQLLocalDB
sqllocaldb start MSSQLLocalDB
sqllocaldb info MSSQLLocalDB

"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start

在测试任务之前运行 在测试开始之前运行 Azure 存储模拟器实例?

标签: azureazure-devopsazure-storageazure-pipelinesazure-pipelines-build-task

解决方案


尝试这个:

- script: '"C:\Program Files\Microsoft SQL Server\130\Tools\Binn\SqlLocalDB.exe" create "v13.0" 13.0 -s'
  displayName: 'Init Test Db'

- script: '"C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start'
  displayName: 'Start Storage Emulator'

需要在vs2017-win2016vmImage 上。


推荐阅读