Skip to content

Commit 597fe01

Browse files
authored
Issue918 #918 (#921)
* Removing the vsix project * update * Fix for Issue918, generic fixture * Update pipeline and adding * update azure pipeline yml
1 parent c773ee1 commit 597fe01

8 files changed

Lines changed: 57 additions & 33 deletions

File tree

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ When reporting a bug, please provide the following information to speed up triag
44
* Visual Studio edition and full version number (see Help About)
55
* A short repro, preferably attached or pointing to a git repo or gist
66
* What .net platform and version is being targeted
7-
* If TFS/VSTS issue, what version, hosted, on-premises, and what build task you see this in
7+
* If TFS/VSTS issue, what version, hosted or on-premises, and what build task you see this in
88

NUnit3TestAdapter.sln

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1717
LICENSE.txt = LICENSE.txt
1818
src\native-assembly\NativeTests.dll = src\native-assembly\NativeTests.dll
1919
NuGet.Config = NuGet.Config
20-
.github\workflows\NUnit3TestAdapter.Cake.CI.yml = .github\workflows\NUnit3TestAdapter.Cake.CI.yml
2120
NUnit3TestAdapter.sln.DotSettings = NUnit3TestAdapter.sln.DotSettings
2221
images\nunit_256.png = images\nunit_256.png
2322
Osiris.Extended.ruleset = Osiris.Extended.ruleset
@@ -51,6 +50,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp2.1", "netcoreapp
5150
EndProject
5251
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NUnit.TestAdapter.Tests.Acceptance", "src\NUnit.TestAdapter.Tests.Acceptance\NUnit.TestAdapter.Tests.Acceptance.csproj", "{3FAC7EE0-664F-4B11-918B-8E0FF865EE4C}"
5352
EndProject
53+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{062B1763-73C8-4B5A-92DF-C66A36C43CE1}"
54+
ProjectSection(SolutionItems) = preProject
55+
.github\dependabot.yml = .github\dependabot.yml
56+
.github\ISSUE_TEMPLATE.md = .github\ISSUE_TEMPLATE.md
57+
EndProjectSection
58+
EndProject
59+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{7D708804-B2F1-4A31-A9FB-85A0C7433200}"
60+
ProjectSection(SolutionItems) = preProject
61+
.github\workflows\NUnit3TestAdapter.Cake.CI.yml = .github\workflows\NUnit3TestAdapter.Cake.CI.yml
62+
EndProjectSection
63+
EndProject
5464
Global
5565
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5666
Debug|Any CPU = Debug|Any CPU
@@ -88,6 +98,8 @@ Global
8898
GlobalSection(NestedProjects) = preSolution
8999
{D41249E3-C080-4B66-8CBD-99CE4D309A10} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
90100
{A9584E41-6ECE-44B4-A504-41795A65DA5F} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
101+
{062B1763-73C8-4B5A-92DF-C66A36C43CE1} = {7CE30108-5D81-4850-BE6B-C8BCA35D3592}
102+
{7D708804-B2F1-4A31-A9FB-85A0C7433200} = {062B1763-73C8-4B5A-92DF-C66A36C43CE1}
91103
EndGlobalSection
92104
GlobalSection(ExtensibilityGlobals) = postSolution
93105
SolutionGuid = {8EF03474-188E-44A8-8C76-9FBCF9A382EC}

azure-pipelines.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@ jobs:
1111
- powershell: .\build.ps1 --target=CI --configuration=$(BuildConfiguration)
1212
displayName: Build, package, and test
1313

14-
- task: PublishBuildArtifacts@1
15-
displayName: Publish bin artifacts
16-
inputs:
17-
PathtoPublish: $(build.sourcesdirectory)\bin\$(BuildConfiguration)
18-
ArtifactName: Bin
19-
condition: succeededOrFailed()
20-
21-
- task: PublishBuildArtifacts@1
22-
displayName: Publish package artifacts
23-
inputs:
24-
PathtoPublish: $(build.sourcesdirectory)\package
25-
ArtifactName: Package
26-
condition: succeededOrFailed()
2714

2815
- job: Linux
2916
pool:

build.cake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ var configuration = Argument("configuration", "Release");
1212
// SET PACKAGE VERSION
1313
//////////////////////////////////////////////////////////////////////
1414

15-
var version = "4.1.0";
16-
var modifier = "";
15+
var version = "4.2.0";
16+
var modifier = "-alpha.1";
1717

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

src/NUnitTestAdapter/NUnitEngine/DiscoveryConverter.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,16 @@ private void ExtractTestFixtures(NUnitDiscoveryCanHaveTestFixture parent, XEleme
282282
ExtractTestFixtures(ptf, child);
283283
}
284284
break;
285+
case GenericFixture:
286+
var gf = ExtractGenericTestFixture(parent, node);
287+
parent.AddTestGenericFixture(gf);
288+
if (child.HasElements)
289+
{
290+
ExtractTestFixtures(gf, child);
291+
}
292+
break;
285293
default:
286-
throw new DiscoveryException($"Not a TestFixture, SetUpFixture, ParameterizedFixture or TestSuite, but {type}");
294+
throw new DiscoveryException($"Not a TestFixture, SetUpFixture, ParameterizedFixture, GenericFixture or TestSuite, but {type}");
287295
}
288296
}
289297
}

src/NUnitTestAdapter/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using System.Runtime.InteropServices;
1010

1111
[assembly: AssemblyTitle("NUnit3 Test Adapter for Visual Studio")]
12-
[assembly: AssemblyDescription("A package containing the NUnit3 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 Azure DevOps server.\r\n \r\nNote that this package ONLY contains the adapter, not the NUnit framework. You must also get the framework.\r\n\r\nThe package works with Visual Studio 2012 and newer.\r\n")]
12+
[assembly: AssemblyDescription("A package containing the NUnit3 TestAdapter for Visual Studio 2012 onwards. \n\r\nThe package works with Visual Studio 2012 and newer, dotnet test and VSTest.Console.\r\n")]
1313
[assembly: AssemblyCompany("NUnit Project")]
1414
[assembly: AssemblyProduct("NUnit3TestAdapter")]
1515
[assembly: AssemblyCopyright("Copyright © 2011-2021 Charlie Poole, 2014-2021 Terje Sandstrom")]
@@ -21,7 +21,7 @@
2121
[assembly: ComVisible(false)]
2222

2323
[assembly: Guid("c0aad5e4-b486-49bc-b3e8-31e01be6fefe")]
24-
[assembly: AssemblyVersion("4.1.0.0")]
25-
[assembly: AssemblyFileVersion("4.1.0.0")]
24+
[assembly: AssemblyVersion("4.2.0.0")]
25+
[assembly: AssemblyFileVersion("4.2.0.0")]
2626

2727
[assembly: InternalsVisibleTo("NUnit.VisualStudio.TestAdapter.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010029b97dea816272cc4ea44cf3cf666f8150d6dfe1274b6c2e6c4d54259b756888ec08ad6dd3ea0f540b30408b948ae5f39cf0c7b210abdec267b367ce1eccab97d5c6c02ee67090827ffd699544fa2add4849b45a1901eac08495bfee0397fba3946ff3912ce0b9a497818e418a77a0c8db4ca1780e7b6f6dd6911395fcc0faba")]

src/NUnitTestAdapterTests/NUnitEngineTests/NUnitDiscoveryTests.cs

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,16 +1120,6 @@ public void ThatSetUpFixtureWorksIssue824()
11201120
@"<test-run id='0' name='NUnitTestAdapterIssueRepro.dll' fullname='d:\repos\NUnit\nunitissues_otherrepos\Issue884\NUnitTestAdapterIssueRepro\bin\Debug\netcoreapp3.1\NUnitTestAdapterIssueRepro.dll' runstate='Runnable' testcasecount='3'>
11211121
<test-suite type='Assembly' id='0-1010' name='NUnitTestAdapterIssueRepro.dll' fullname='d:/repos/NUnit/nunitissues_otherrepos/Issue884/NUnitTestAdapterIssueRepro/bin/Debug/netcoreapp3.1/NUnitTestAdapterIssueRepro.dll' runstate='Runnable' testcasecount='3'>
11221122
<environment framework-version='3.13.2.0' clr-version='3.1.19' os-version='Microsoft Windows 10.0.19042' platform='Win32NT' cwd='d:\repos\NUnit\nunitissues_otherrepos\Issue884\NUnitTestAdapterIssueRepro\bin\Debug\netcoreapp3.1' machine-name='DESKTOP-SIATMVB' user='TerjeSandstrom' user-domain='AzureAD' culture='en-US' uiculture='en-US' os-architecture='x64' />
1123-
<settings>
1124-
<setting name='SynchronousEvents' value='False' />
1125-
<setting name='InternalTraceLevel' value='Off' />
1126-
<setting name='RandomSeed' value='2091732297' />
1127-
<setting name='ProcessModel' value='InProcess' />
1128-
<setting name='DomainUsage' value='Single' />
1129-
<setting name='DefaultTestNamePattern' value='{m}{a}' />
1130-
<setting name='WorkDirectory' value='d:\repos\NUnit\nunitissues_otherrepos\Issue884\NUnitTestAdapterIssueRepro\bin\Debug\netcoreapp3.1' />
1131-
<setting name='NumberOfTestWorkers' value='28' />
1132-
</settings>
11331123
<properties>
11341124
<property name='_PID' value='36768' />
11351125
<property name='_APPDOMAIN' value='testhost' />
@@ -1159,6 +1149,34 @@ public void ThatSetUpFixtureWorksIssue884()
11591149
Assert.That(ndr, Is.Not.Null);
11601150
}
11611151

1152+
private const string GenericIssue918 = @"<test-run id='0' name='Issue918.dll' fullname='d:\repos\NUnit\nunit3-vs-adapter.issues\Issue918\bin\Debug\net6.0\Issue918.dll' runstate='Runnable' testcasecount='1'>
1153+
<test-suite type='Assembly' id='0-1004' name='Issue918.dll' fullname='d:/repos/NUnit/nunit3-vs-adapter.issues/Issue918/bin/Debug/net6.0/Issue918.dll' runstate='Runnable' testcasecount='1'>
1154+
<environment framework-version='3.13.2.0' clr-version='6.0.0' os-version='Microsoft Windows 10.0.19042' platform='Win32NT' cwd='d:\repos\NUnit\nunit3-vs-adapter.issues\Issue918\bin\Debug\net6.0' machine-name='DESKTOP-SIATMVB' user='TerjeSandstrom' user-domain='AzureAD' culture='en-US' uiculture='en-US' os-architecture='x64' />
1155+
<properties>
1156+
<property name='_PID' value='90212' />
1157+
<property name='_APPDOMAIN' value='testhost' />
1158+
</properties>
1159+
<test-suite type='TestSuite' id='0-1005' name='Issue918' fullname='Issue918' runstate='Runnable' testcasecount='1'>
1160+
<test-suite type='GenericFixture' id='0-1003' name='Tests+SomeTest&lt;T&gt;' fullname='Issue918.Tests+SomeTest&lt;T&gt;' runstate='Runnable' testcasecount='1'>
1161+
<test-suite type='GenericFixture' id='0-1000' name='Tests+SomeTest&lt;T&gt;' fullname='Issue918.Tests+SomeTest&lt;T&gt;' runstate='Runnable' testcasecount='1'>
1162+
<test-suite type='TestFixture' id='0-1001' name='Tests+SomeTest&lt;Object&gt;' fullname='Issue918.Tests+SomeTest&lt;Object&gt;' classname='Issue918.Tests+SomeTest`1' runstate='Runnable' testcasecount='1'>
1163+
<test-case id='0-1002' name='Foo' fullname='Issue918.Tests+SomeTest&lt;Object&gt;.Foo' methodname='Foo' classname='Issue918.Tests+SomeTest`1' runstate='Runnable' seed='506899496' />
1164+
</test-suite>
1165+
</test-suite>
1166+
</test-suite>
1167+
</test-suite>
1168+
</test-suite>
1169+
</test-run>";
1170+
1171+
[Test]
1172+
public void ThatGenericFixturesWorksIssue918()
1173+
{
1174+
var sut = new DiscoveryConverter(logger, settings);
1175+
var ndr = sut.ConvertXml(
1176+
new NUnitResults(XmlHelper.CreateXmlNode(GenericIssue918)));
1177+
Assert.That(ndr, Is.Not.Null);
1178+
}
1179+
11621180

11631181
private const string ExtractFixturesHandlesProperties =
11641182
@"<test-run id='0' name='Issue824.dll' fullname='d:\repos\NUnit\nunit3-vs-adapter.issues\Issue824\bin\Debug\net5.0\Issue824.dll' runstate='Runnable' testcasecount='2'>

src/NUnitTestAdapterTests/ProjectTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ***********************************************************************
2-
// Copyright (c) 2011-2017 Charlie Poole, Terje Sandstrom
2+
// Copyright (c) 2011-2017 Charlie Poole, 2014-2021 Terje Sandstrom
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining
55
// a copy of this software and associated documentation files (the
@@ -23,7 +23,6 @@
2323
using System.IO;
2424
using System.Linq;
2525
using System.Reflection;
26-
using System.Xml.Linq;
2726
using NUnit.Framework;
2827

2928
namespace NUnit.VisualStudio.TestAdapter.Tests

0 commit comments

Comments
 (0)