0

I'm relatively new to yaml and have some azure pipelines to maintain.

The variable below is used to run unit tests in azure DevOps but there has now been added a test project named Api.Tests.RestSharp which I wish to be excluded from being run

unitTestsGlob: $(Build.SourcesDirectory)\**\*Tests\*.csproj

How can I update this to exclude a specific project name?

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
atamata
  • 997
  • 3
  • 14
  • 32
  • In YAML there is no such thing as a path. For YAML you have a single key and value in a root level block style mapping, nothing special about that. – Anthon Jun 03 '22 at 10:27
  • I found the answer here: https://stackoverflow.com/questions/60321752/excluding-projects-from-build-in-yaml-configuration-azure-pipelines – atamata Jun 03 '22 at 11:18

1 Answers1

0

My solution:

unitTestsGlob: |
    $(Build.SourcesDirectory)\**\*Tests\*.csproj
    !$(Build.SourcesDirectory)\**\*RestSharp*\*.csproj
atamata
  • 997
  • 3
  • 14
  • 32