I have this Azure build pipeline, which starts a VSTest Task. It should test all projects that end with "Unittest.csproj", but it should exclude test projects that end with "Common.Unittest.csproj":
# my-azure-pipeline.yaml:
...
steps:
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**/*Unittest.csproj
! **/*Common.Unittest.csproj
...
This works fine.
As I have a couple of similar builds, I want to extract a build template (myTemplate.yaml), which now uses a variable $(testprojects) for value "testAssemblyVer2":
# myTemplate.yaml
...
steps:
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: $(testProjects)
...
Now I tried to set the variable like this, but no luck:
# my-azure-pipeline.yaml
...
variables:
- testProjects: |
**/FistUnittestProject.csproj
! **/SecondUnittestProject.csproj
extends:
template: myTemplate.yaml
...
I wonder which is the proper way to define a "multiline thing" via a variable?
Any help appreciated.