<p>I noticed that the <a href="https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/DotNetCoreCLIV2/README.md" rel="nofollow noreferrer">description</a> for the filepath properties of the <strong>pack</strong> command is different than the descriptions in the <strong>test</strong> and <strong>publish</strong> commands:</p>

<pre><code>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.csproj
</code></pre>

<p>So perhaps try <code>-:**/*[Tt]ests.csproj;**/*.csproj</code> instead. I don't think this explains why the unit tests are excluded and the integrated tests are not, though.</p>

CC BY-SA 4.0
2019-05-26T21:59:02.167Z
2019-07-09T19:20:55.523Z
2019-07-09T19:20:55.523Z
AHaleIII
<p>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.</p>

<p>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.</p>

<p>My Projects in the solution:</p>

<ul>
<li>MyProject.Common</li>
<li>MyProject.Common.UnitTests</li>
<li>MyProject</li>
<li>MyProject.UnitTests</li>
<li>MyProject.IntegrationTests</li>
</ul>

<p>I am using .net core v2 steps </p>

<p>Restore<br>
Build<br>
Test<br>
Publish<br>
Pack<br>
Push</p>

<p>Test Path to project (works)</p>

<blockquote>
  <p><code>**/*[Uu]nit[Tt]ests.csproj</code></p>
</blockquote>

<p>Publish Path to projects (works)</p>

<blockquote>
  <p><code>!**/*[Tt]ests.csproj</code><br>
  <code>**/*.csproj</code></p>
</blockquote>

<p>Pack path to project (does not work - filters unit test projects, but not integration test)</p>

<blockquote>
  <p><code>!**/*[Tt]ests.csproj;**/*.csproj</code></p>
</blockquote>

<azure-devops><build-pipeline><azure-pipelines><dotnet>
Azure Devops: Filter Test Projects in Nuget Build Pipeline
Josh
# Azure Devops: Filter Test Projects in Nuget Build Pipeline

(Asked by: username_0 on 2019-03-25)

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:

* 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.csproj`

Publish Path to projects (works)

> `!**/*[Tt]ests.csproj`  
> `**/*.csproj`

Pack path to project (does not work - filters unit test projects, but not integration test)

> `!**/*[Tt]ests.csproj;**/*.csproj`

**Tags:** azure-devops, build-pipeline, azure-pipelines, dotnet


---

## 1 answers

### Answer by username_1 on 2019-05-26. Score: 3 | Accepted answer

I noticed that the description for the filepath properties of the pack command is different than the descriptions in the test and publish commands:
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.csproj

So 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.


---

