Skip to content

Commit

Permalink
Adding prefilter featureflag to runsettings, with default off. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
OsirisTerje authored Aug 29, 2019
1 parent 3d976ae commit fbf83ac
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var configuration = Argument("configuration", "Release");
// SET PACKAGE VERSION
//////////////////////////////////////////////////////////////////////

var version = "3.15.0";
var version = "3.15.1";
var modifier = "";

var dbgSuffix = configuration.ToLower() == "debug" ? "-dbg" : "";
Expand Down
2 changes: 1 addition & 1 deletion src/NUnit3TestAdapterInstall/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="NUnit.NUnit3TestAdapter" Version="3.15.0.0" Language="en-US" Publisher="Charlie Poole, Terje Sandstrom" />
<Identity Id="NUnit.NUnit3TestAdapter" Version="3.15.1.0" Language="en-US" Publisher="Charlie Poole, Terje Sandstrom" />
<DisplayName>NUnit 3 Test Adapter</DisplayName>
<Description xml:space="preserve">NUnit 3 adapter for running tests in Visual Studio. Works with NUnit 3.x.
For running NUnit 2 tests, use the NUnit 2 adapter.</Description>
Expand Down
9 changes: 8 additions & 1 deletion src/NUnitTestAdapter/AdapterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public interface IAdapterSettings
bool DumpXmlTestDiscovery { get; }
bool DumpXmlTestResults { get; }

bool PreFilter { get; }

/// <summary>
/// Syntax documentation <see cref="https://github.com/nunit/docs/wiki/Template-Based-Test-Naming"/>
/// </summary>
Expand Down Expand Up @@ -100,7 +102,7 @@ public class AdapterSettings : IAdapterSettings
{
private const string RANDOM_SEED_FILE = "nunit_random_seed.tmp";
private TestLogger _logger;

#region Constructor

public AdapterSettings(TestLogger logger)
Expand Down Expand Up @@ -196,6 +198,10 @@ public AdapterSettings(TestLogger logger)
/// </summary>
public string DefaultTestNamePattern { get; set; }

public bool PreFilter { get; private set; }



#endregion

#region Public Methods
Expand Down Expand Up @@ -263,6 +269,7 @@ public void Load(string settingsXml)
ShowInternalProperties = GetInnerTextAsBool(nunitNode, nameof(ShowInternalProperties), false);
DumpXmlTestDiscovery = GetInnerTextAsBool(nunitNode, nameof(DumpXmlTestDiscovery), false);
DumpXmlTestResults = GetInnerTextAsBool(nunitNode, nameof(DumpXmlTestResults), false);
PreFilter = GetInnerTextAsBool(nunitNode, nameof(PreFilter), false);
var vsTestCategoryType = GetInnerText(nunitNode, nameof(VsTestCategoryType), Verbosity > 0);
if (vsTestCategoryType != null)
switch (vsTestCategoryType.ToLower())
Expand Down
2 changes: 1 addition & 1 deletion src/NUnitTestAdapter/NUnitTestAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private TestPackage CreateTestPackage(string assemblyName, IGrouping<string, Tes
package.Settings[PackageSettings.NumberOfTestWorkers] = workers;
}

if (testCases != null)
if (Settings.PreFilter && testCases != null)
{
var prefilters = new List<string>();

Expand Down
6 changes: 3 additions & 3 deletions src/NUnitTestAdapter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("NUnit 3 Test Adapter for Visual Studio")]
[assembly: AssemblyDescription("A package including the NUnit 3 TestAdapter for Visual Studio 2012 onwards. With this package you don't need to install the VSIX adapter package, and you don't need to upload the adapter to your TFS server.\r\n \r\nNote that this package ONLY contains the adapter, not the NUnit framework. You must also get the framework. You only need one such package for a solution. \r\n\r\nThe package works with Visual Studio 2012 and newer.\r\n")]
[assembly: AssemblyDescription("A package containing the NUnit 3 TestAdapter for Visual Studio 2012 onwards. With this package you don't need to install the VSIX adapter package, and you don't need to upload the adapter to your TFS server.\r\n \r\nNote that this package ONLY contains the adapter, not the NUnit framework. You must also get the framework. You only need one such package for a solution. \r\n\r\nThe package works with Visual Studio 2012 and newer.\r\n")]
[assembly: AssemblyCompany("NUnit Project")]
[assembly: AssemblyProduct("NUnit3TestAdapter")]
[assembly: AssemblyCopyright("Copyright © 2011-2019 Charlie Poole, 2014-2019 Terje Sandstrom")]
Expand All @@ -21,7 +21,7 @@
[assembly: ComVisible(false)]

[assembly: Guid("c0aad5e4-b486-49bc-b3e8-31e01be6fefe")]
[assembly: AssemblyVersion("3.15.0.0")]
[assembly: AssemblyFileVersion("3.15.0.0")]
[assembly: AssemblyVersion("3.15.1.0")]
[assembly: AssemblyFileVersion("3.15.1.0")]

[assembly: InternalsVisibleTo("NUnit.VisualStudio.TestAdapter.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010029b97dea816272cc4ea44cf3cf666f8150d6dfe1274b6c2e6c4d54259b756888ec08ad6dd3ea0f540b30408b948ae5f39cf0c7b210abdec267b367ce1eccab97d5c6c02ee67090827ffd699544fa2add4849b45a1901eac08495bfee0397fba3946ff3912ce0b9a497818e418a77a0c8db4ca1780e7b6f6dd6911395fcc0faba")]
14 changes: 14 additions & 0 deletions src/NUnitTestAdapterTests/AdapterSettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,20 @@ public void UseVsKeepEngineRunningSetting()
Assert.True(_settings.UseVsKeepEngineRunning);
}

[Test]
public void PreFilterIsDefaultOff()
{
Assert.That(_settings.PreFilter,Is.False);
}

[Test]
public void PreFilterCanBeSet()
{
_settings.Load("<RunSettings><NUnit><PreFilter>true</PreFilter></NUnit></RunSettings>");
Assert.That(_settings.PreFilter);
}


[Test]
public void BasePathSetting()
{
Expand Down

0 comments on commit fbf83ac

Please sign in to comment.