Skip to content

Commit 7329666

Browse files
authored
450alpha2 (#1095)
* Added engine with fix for NUnit 4 * Updated test projects * Updating to 4.5.0 * commented out local nuget feed * resetting frameworks for test project * Updateing target frameworks * Fix for issue #1097
1 parent 364f81e commit 7329666

File tree

8 files changed

+130
-115
lines changed

8 files changed

+130
-115
lines changed

build.cake

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ var configuration = Argument("configuration", "Release");
1515

1616
var version = "4.5.0";
1717

18-
var modifier = "-alpha.3";
19-
18+
var modifier = "";
2019

2120
var dbgSuffix = configuration.ToLower() == "debug" ? "-dbg" : "";
2221
var packageVersion = version + modifier + dbgSuffix;

nuget.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<packageSources>
44
<clear />
55
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
6-
<add key="Local" value="c:\nuget" />
6+
<!--<add key="Local" value="c:\nuget" />-->
77
</packageSources>
88
</configuration>

src/NUnit3AdapterExternalTests/NUnit3AdapterExternalTests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>NUnit.VisualStudio.TestAdapter.ExternalTests</AssemblyName>
55
<RootNamespace>NUnit.VisualStudio.TestAdapter.Tests</RootNamespace>
6-
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
6+
<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
77
</PropertyGroup>
88

99
<ItemGroup>

src/NUnitTestAdapter/AdapterSettings.cs

+3-104
Original file line numberDiff line numberDiff line change
@@ -33,110 +33,6 @@
3333

3434
namespace NUnit.VisualStudio.TestAdapter
3535
{
36-
public interface IAdapterSettings
37-
{
38-
int MaxCpuCount { get; }
39-
string ResultsDirectory { get; }
40-
string TargetPlatform { get; }
41-
string TargetFrameworkVersion { get; }
42-
string TestAdapterPaths { get; }
43-
bool CollectSourceInformation { get; }
44-
IDictionary<string, string> TestProperties { get; }
45-
InternalTraceLevel InternalTraceLevelEnum { get; }
46-
string WorkDirectory { get; }
47-
string Where { get; }
48-
int DefaultTimeout { get; }
49-
int NumberOfTestWorkers { get; }
50-
bool ShadowCopyFiles { get; }
51-
int Verbosity { get; }
52-
bool UseVsKeepEngineRunning { get; }
53-
string BasePath { get; }
54-
string PrivateBinPath { get; }
55-
int? RandomSeed { get; }
56-
bool RandomSeedSpecified { get; }
57-
bool InProcDataCollectorsAvailable { get; }
58-
// ReSharper disable once UnusedMemberInSuper.Global
59-
bool CollectDataForEachTestSeparately { get; } // Used implicitly by MS
60-
bool SynchronousEvents { get; }
61-
string DomainUsage { get; }
62-
bool DumpXmlTestDiscovery { get; }
63-
bool DumpXmlTestResults { get; }
64-
65-
bool DumpVsInput { get; }
66-
67-
bool PreFilter { get; }
68-
69-
/// <summary>
70-
/// Syntax documentation <see cref="https://github.com/nunit/docs/wiki/Template-Based-Test-Naming"/>.
71-
/// </summary>
72-
string DefaultTestNamePattern { get; }
73-
74-
VsTestCategoryType VsTestCategoryType { get; }
75-
string TestOutputXml { get; }
76-
bool UseTestOutputXml { get; }
77-
OutputXmlFolderMode OutputXmlFolderMode { get; }
78-
79-
/// <summary>
80-
/// For retry runs create a new file for each run.
81-
/// </summary>
82-
bool NewOutputXmlFileForEachRun { get; }
83-
84-
/// <summary>
85-
/// True if test run is triggered in an IDE/Editor context.
86-
/// </summary>
87-
bool DesignMode { get; }
88-
89-
/// <summary>
90-
/// If true, an adapter shouldn't create appdomains to run tests.
91-
/// </summary>
92-
bool DisableAppDomain { get; }
93-
94-
/// <summary>
95-
/// If true, an adapter should disable any test case parallelization.
96-
/// </summary>
97-
bool DisableParallelization { get; }
98-
99-
bool ShowInternalProperties { get; }
100-
101-
bool UseParentFQNForParametrizedTests { get; }
102-
103-
bool UseNUnitIdforTestCaseId { get; }
104-
105-
int ConsoleOut { get; }
106-
bool StopOnError { get; }
107-
TestOutcome MapWarningTo { get; }
108-
bool UseTestNameInConsoleOutput { get; }
109-
DisplayNameOptions DisplayName { get; }
110-
char FullnameSeparator { get; }
111-
DiscoveryMethod DiscoveryMethod { get; }
112-
bool SkipNonTestAssemblies { get; }
113-
114-
int AssemblySelectLimit { get; }
115-
116-
bool UseNUnitFilter { get; }
117-
bool IncludeStackTraceForSuites { get; }
118-
119-
120-
void Load(IDiscoveryContext context, TestLogger testLogger = null);
121-
void Load(string settingsXml);
122-
void SaveRandomSeed(string dirname);
123-
void RestoreRandomSeed(string dirname);
124-
125-
bool EnsureAttachmentFileScheme { get; }
126-
127-
// For Internal Development use
128-
bool FreakMode { get; } // displays metadata instead of real data in Test Explorer
129-
bool Debug { get; }
130-
bool DebugExecution { get; }
131-
bool DebugDiscovery { get; }
132-
133-
// Filter control
134-
ExplicitModeEnum ExplicitMode { get; }
135-
bool SkipExecutionWhenNoTests { get; }
136-
string TestOutputFolder { get; }
137-
string SetTestOutputFolder(string workDirectory);
138-
}
139-
14036
public enum VsTestCategoryType
14137
{
14238
NUnit,
@@ -197,6 +93,8 @@ public AdapterSettings(ITestLogger logger)
19793
/// </summary>
19894
public bool DisableParallelization { get; private set; }
19995

96+
public bool AllowParallelWithDebugger { get; private set; }
97+
20098
/// <summary>
20199
/// True if test run is triggered in an IDE/Editor context.
202100
/// </summary>
@@ -524,6 +422,7 @@ private void ExtractRunConfiguration(XmlDocument doc)
524422
CollectSourceInformation = GetInnerTextAsBool(runConfiguration, nameof(CollectSourceInformation), true);
525423
DisableAppDomain = GetInnerTextAsBool(runConfiguration, nameof(DisableAppDomain), false);
526424
DisableParallelization = GetInnerTextAsBool(runConfiguration, nameof(DisableParallelization), false);
425+
AllowParallelWithDebugger = GetInnerTextAsBool(runConfiguration, nameof(AllowParallelWithDebugger), false);
527426
DesignMode = GetInnerTextAsBool(runConfiguration, nameof(DesignMode), false);
528427
CollectDataForEachTestSeparately =
529428
GetInnerTextAsBool(runConfiguration, nameof(CollectDataForEachTestSeparately), false);
+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
using System.Collections.Generic;
2+
3+
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
4+
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
5+
6+
using NUnit.Engine;
7+
8+
namespace NUnit.VisualStudio.TestAdapter;
9+
10+
public interface IAdapterSettings
11+
{
12+
int MaxCpuCount { get; }
13+
string ResultsDirectory { get; }
14+
string TargetPlatform { get; }
15+
string TargetFrameworkVersion { get; }
16+
string TestAdapterPaths { get; }
17+
bool CollectSourceInformation { get; }
18+
IDictionary<string, string> TestProperties { get; }
19+
InternalTraceLevel InternalTraceLevelEnum { get; }
20+
string WorkDirectory { get; }
21+
string Where { get; }
22+
int DefaultTimeout { get; }
23+
int NumberOfTestWorkers { get; }
24+
bool ShadowCopyFiles { get; }
25+
int Verbosity { get; }
26+
bool UseVsKeepEngineRunning { get; }
27+
string BasePath { get; }
28+
string PrivateBinPath { get; }
29+
int? RandomSeed { get; }
30+
bool RandomSeedSpecified { get; }
31+
bool InProcDataCollectorsAvailable { get; }
32+
// ReSharper disable once UnusedMemberInSuper.Global
33+
bool CollectDataForEachTestSeparately { get; } // Used implicitly by MS
34+
bool SynchronousEvents { get; }
35+
string DomainUsage { get; }
36+
bool DumpXmlTestDiscovery { get; }
37+
bool DumpXmlTestResults { get; }
38+
39+
bool DumpVsInput { get; }
40+
41+
bool PreFilter { get; }
42+
43+
/// <summary>
44+
/// Syntax documentation <see cref="https://github.com/nunit/docs/wiki/Template-Based-Test-Naming"/>.
45+
/// </summary>
46+
string DefaultTestNamePattern { get; }
47+
48+
VsTestCategoryType VsTestCategoryType { get; }
49+
string TestOutputXml { get; }
50+
bool UseTestOutputXml { get; }
51+
OutputXmlFolderMode OutputXmlFolderMode { get; }
52+
53+
/// <summary>
54+
/// For retry runs create a new file for each run.
55+
/// </summary>
56+
bool NewOutputXmlFileForEachRun { get; }
57+
58+
/// <summary>
59+
/// True if test run is triggered in an IDE/Editor context.
60+
/// </summary>
61+
bool DesignMode { get; }
62+
63+
/// <summary>
64+
/// If true, an adapter shouldn't create appdomains to run tests.
65+
/// </summary>
66+
bool DisableAppDomain { get; }
67+
68+
/// <summary>
69+
/// If true, an adapter should disable any test case parallelization.
70+
/// </summary>
71+
bool DisableParallelization { get; }
72+
73+
/// <summary>
74+
/// Default is that when the adapter notice it is running with a debugger attached it will disable parallelization.
75+
/// By changing this setting to `true` the adapter will allow parallelization even if a debugger is attached.
76+
/// </summary>
77+
bool AllowParallelWithDebugger { get; }
78+
79+
bool ShowInternalProperties { get; }
80+
81+
bool UseParentFQNForParametrizedTests { get; }
82+
83+
bool UseNUnitIdforTestCaseId { get; }
84+
85+
int ConsoleOut { get; }
86+
bool StopOnError { get; }
87+
TestOutcome MapWarningTo { get; }
88+
bool UseTestNameInConsoleOutput { get; }
89+
DisplayNameOptions DisplayName { get; }
90+
char FullnameSeparator { get; }
91+
DiscoveryMethod DiscoveryMethod { get; }
92+
bool SkipNonTestAssemblies { get; }
93+
94+
int AssemblySelectLimit { get; }
95+
96+
bool UseNUnitFilter { get; }
97+
bool IncludeStackTraceForSuites { get; }
98+
99+
100+
void Load(IDiscoveryContext context, TestLogger testLogger = null);
101+
void Load(string settingsXml);
102+
void SaveRandomSeed(string dirname);
103+
void RestoreRandomSeed(string dirname);
104+
105+
bool EnsureAttachmentFileScheme { get; }
106+
107+
// For Internal Development use
108+
bool FreakMode { get; } // displays metadata instead of real data in Test Explorer
109+
bool Debug { get; }
110+
bool DebugExecution { get; }
111+
bool DebugDiscovery { get; }
112+
113+
// Filter control
114+
ExplicitModeEnum ExplicitMode { get; }
115+
bool SkipExecutionWhenNoTests { get; }
116+
string TestOutputFolder { get; }
117+
string SetTestOutputFolder(string workDirectory);
118+
}

src/NUnitTestAdapter/NUnit.TestAdapter.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<AssemblyName>NUnit3.TestAdapter</AssemblyName>
55
<!--<AssemblyName>NUnit3.TestAdapterDebug</AssemblyName>-->
66
<RootNamespace>NUnit.VisualStudio.TestAdapter</RootNamespace>
7-
<TargetFramework>netcoreapp3.1</TargetFramework>
7+
<!--<TargetFramework>netcoreapp3.1</TargetFramework>-->
88
<!-- For testing and debugging-->
9-
<!--<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>-->
9+
<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
1010
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
1111
<SourceLinkOriginUrl>https://github.com/nunit/nunit3-vs-adapter</SourceLinkOriginUrl>
1212
<SourceLinkCreate>true</SourceLinkCreate>
@@ -33,7 +33,7 @@
3333

3434
<ItemGroup>
3535
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" />
36-
<PackageReference Include="nunit.engine" Version="3.15.4-pre00001" />
36+
<PackageReference Include="nunit.engine" Version="3.15.4" />
3737
<PackageReference Include="TestCentric.Metadata" Version="1.7.1" Aliases="TestCentric" />
3838
</ItemGroup>
3939

src/NUnitTestAdapter/NUnitTestAdapter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ protected TestPackage CreateTestPackage(string assemblyName, IGrouping<string, T
198198
TestLog.Debug(" Setting ShadowCopyFiles to true");
199199
}
200200

201-
if (Debugger.IsAttached)
201+
if (Debugger.IsAttached && !Settings.AllowParallelWithDebugger)
202202
{
203203
package.Settings[PackageSettings.NumberOfTestWorkers] = 0;
204204
TestLog.Debug(" Setting NumberOfTestWorkers to zero for Debugging");

src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
<IsTestProject>true</IsTestProject>
55
<RootNamespace>NUnit.VisualStudio.TestAdapter.Tests</RootNamespace>
66
<AssemblyName>NUnit.VisualStudio.TestAdapter.Tests</AssemblyName>
7-
<!--<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>-->
8-
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
9-
<!-- For testing and debugging-->
7+
<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
8+
<!--<TargetFrameworks>netcoreapp3.1</TargetFrameworks>--> <!-- For testing and debugging-->
109
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1110
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
1211
<LangVersion>latest</LangVersion>

0 commit comments

Comments
 (0)