use*_*186 7 azure azure-devops azure-pipelines
我有这个 Azure 构建管道,它启动 VSTest 任务。它应该测试以“Unittest.csproj”结尾的所有项目,但应排除以“Common.Unittest.csproj”结尾的测试项目:
# my-azure-pipeline.yaml:
...
steps:
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**/*Unittest.csproj
! **/*Common.Unittest.csproj
...
Run Code Online (Sandbox Code Playgroud)
这很好用。
由于我有几个类似的构建,我想提取一个构建模板 (myTemplate.yaml),它现在使用变量 $(testprojects) 作为值“testAssemblyVer2”:
# myTemplate.yaml
...
steps:
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: $(testProjects)
...
Run Code Online (Sandbox Code Playgroud)
现在我尝试像这样设置变量,但没有成功:
# my-azure-pipeline.yaml
...
variables:
- testProjects: |
**/FistUnittestProject.csproj
! **/SecondUnittestProject.csproj
extends:
template: myTemplate.yaml
...
Run Code Online (Sandbox Code Playgroud)
我想知道通过变量定义“多行事物”的正确方法是什么?
任何帮助表示赞赏。
| 归档时间: |
|
| 查看次数: |
6443 次 |
| 最近记录: |