snippetMinor
Azure Devops: Filter Test Projects in Nuget Build Pipeline
Viewed 0 times
nugetprojectspipelineazurefiltertestbuilddevops
Problem
I'm working on a nuget build pipeline. My problem is that my integration test project is being packaged and deployed to the azure artifacts, while my unit test projects are not.
The integration test project is a console application. I want it in the project, but I don't want it to deploy into the artifacts.
My Projects in the solution:
I am using .net core v2 steps
Restore
Build
Test
Publish
Pack
Push
Test Path to project (works)
Publish Path to projects (works)
Pack path to project (does not work - filters unit test projects, but not integration test)
The integration test project is a console application. I want it in the project, but I don't want it to deploy into the artifacts.
My Projects in the solution:
- MyProject.Common
- MyProject.Common.UnitTests
- MyProject
- MyProject.UnitTests
- MyProject.IntegrationTests
I am using .net core v2 steps
Restore
Build
Test
Publish
Pack
Push
Test Path to project (works)
**/*[Uu]nit[Tt]ests.csprojPublish Path to projects (works)
!**/*[Tt]ests.csproj**/*.csprojPack path to project (does not work - filters unit test projects, but not integration test)
!/[Tt]ests.csproj;/.csprojSolution
I noticed that the description for the filepath properties of the pack command is different than the descriptions in the test and publish commands:
So perhaps try
Pattern to search for csproj or nuspec files to pack.
You can separate multiple patterns with a semicolon, and you can
make a pattern negative by prefixing it with '-:'. Example:
**/*.csproj;-:**/*.Tests.csprojSo perhaps try
-:/[Tt]ests.csproj;/.csproj instead. I don't think this explains why the unit tests are excluded and the integrated tests are not, though.Code Snippets
Pattern to search for csproj or nuspec files to pack.
You can separate multiple patterns with a semicolon, and you can
make a pattern negative by prefixing it with '-:'. Example:
**/*.csproj;-:**/*.Tests.csprojContext
StackExchange DevOps Q#6689, answer score: 3
Revisions (0)
No revisions yet.