Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue918 #918 #921

Merged
merged 7 commits into from Nov 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Expand Up @@ -4,5 +4,5 @@ When reporting a bug, please provide the following information to speed up triag
* Visual Studio edition and full version number (see Help About)
* A short repro, preferably attached or pointing to a git repo or gist
* What .net platform and version is being targeted
* If TFS/VSTS issue, what version, hosted, on-premises, and what build task you see this in
* If TFS/VSTS issue, what version, hosted or on-premises, and what build task you see this in

14 changes: 13 additions & 1 deletion NUnit3TestAdapter.sln
Expand Up @@ -17,7 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
LICENSE.txt = LICENSE.txt
src\native-assembly\NativeTests.dll = src\native-assembly\NativeTests.dll
NuGet.Config = NuGet.Config
.github\workflows\NUnit3TestAdapter.Cake.CI.yml = .github\workflows\NUnit3TestAdapter.Cake.CI.yml
NUnit3TestAdapter.sln.DotSettings = NUnit3TestAdapter.sln.DotSettings
images\nunit_256.png = images\nunit_256.png
Osiris.Extended.ruleset = Osiris.Extended.ruleset
Expand Down Expand Up @@ -51,6 +50,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp2.1", "netcoreapp
EndProject
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}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{062B1763-73C8-4B5A-92DF-C66A36C43CE1}"
ProjectSection(SolutionItems) = preProject
.github\dependabot.yml = .github\dependabot.yml
.github\ISSUE_TEMPLATE.md = .github\ISSUE_TEMPLATE.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{7D708804-B2F1-4A31-A9FB-85A0C7433200}"
ProjectSection(SolutionItems) = preProject
.github\workflows\NUnit3TestAdapter.Cake.CI.yml = .github\workflows\NUnit3TestAdapter.Cake.CI.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -88,6 +98,8 @@ Global
GlobalSection(NestedProjects) = preSolution
{D41249E3-C080-4B66-8CBD-99CE4D309A10} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
{A9584E41-6ECE-44B4-A504-41795A65DA5F} = {DE347D88-F6ED-4031-AFC2-318F63E39BC9}
{062B1763-73C8-4B5A-92DF-C66A36C43CE1} = {7CE30108-5D81-4850-BE6B-C8BCA35D3592}
{7D708804-B2F1-4A31-A9FB-85A0C7433200} = {062B1763-73C8-4B5A-92DF-C66A36C43CE1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8EF03474-188E-44A8-8C76-9FBCF9A382EC}
Expand Down
13 changes: 0 additions & 13 deletions azure-pipelines.yml
Expand Up @@ -11,19 +11,6 @@ jobs:
- powershell: .\build.ps1 --target=CI --configuration=$(BuildConfiguration)
displayName: Build, package, and test

- task: PublishBuildArtifacts@1
displayName: Publish bin artifacts
inputs:
PathtoPublish: $(build.sourcesdirectory)\bin\$(BuildConfiguration)
ArtifactName: Bin
condition: succeededOrFailed()

- task: PublishBuildArtifacts@1
displayName: Publish package artifacts
inputs:
PathtoPublish: $(build.sourcesdirectory)\package
ArtifactName: Package
condition: succeededOrFailed()

- job: Linux
pool:
Expand Down
4 changes: 2 additions & 2 deletions build.cake
Expand Up @@ -12,8 +12,8 @@ var configuration = Argument("configuration", "Release");
// SET PACKAGE VERSION
//////////////////////////////////////////////////////////////////////

var version = "4.1.0";
var modifier = "";
var version = "4.2.0";
var modifier = "-alpha.1";

var dbgSuffix = configuration.ToLower() == "debug" ? "-dbg" : "";
var packageVersion = version + modifier + dbgSuffix;
Expand Down
10 changes: 9 additions & 1 deletion src/NUnitTestAdapter/NUnitEngine/DiscoveryConverter.cs
Expand Up @@ -282,8 +282,16 @@ private void ExtractTestFixtures(NUnitDiscoveryCanHaveTestFixture parent, XEleme
ExtractTestFixtures(ptf, child);
}
break;
case GenericFixture:
var gf = ExtractGenericTestFixture(parent, node);
parent.AddTestGenericFixture(gf);
if (child.HasElements)
{
ExtractTestFixtures(gf, child);
}
break;
default:
throw new DiscoveryException($"Not a TestFixture, SetUpFixture, ParameterizedFixture or TestSuite, but {type}");
throw new DiscoveryException($"Not a TestFixture, SetUpFixture, ParameterizedFixture, GenericFixture or TestSuite, but {type}");
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/NUnitTestAdapter/Properties/AssemblyInfo.cs
Expand Up @@ -9,7 +9,7 @@
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("NUnit3 Test Adapter for Visual Studio")]
[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")]
[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")]
[assembly: AssemblyCompany("NUnit Project")]
[assembly: AssemblyProduct("NUnit3TestAdapter")]
[assembly: AssemblyCopyright("Copyright © 2011-2021 Charlie Poole, 2014-2021 Terje Sandstrom")]
Expand All @@ -21,7 +21,7 @@
[assembly: ComVisible(false)]

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

[assembly: InternalsVisibleTo("NUnit.VisualStudio.TestAdapter.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010029b97dea816272cc4ea44cf3cf666f8150d6dfe1274b6c2e6c4d54259b756888ec08ad6dd3ea0f540b30408b948ae5f39cf0c7b210abdec267b367ce1eccab97d5c6c02ee67090827ffd699544fa2add4849b45a1901eac08495bfee0397fba3946ff3912ce0b9a497818e418a77a0c8db4ca1780e7b6f6dd6911395fcc0faba")]
38 changes: 28 additions & 10 deletions src/NUnitTestAdapterTests/NUnitEngineTests/NUnitDiscoveryTests.cs
Expand Up @@ -1120,16 +1120,6 @@ public void ThatSetUpFixtureWorksIssue824()
@"<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'>
<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'>
<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' />
<settings>
<setting name='SynchronousEvents' value='False' />
<setting name='InternalTraceLevel' value='Off' />
<setting name='RandomSeed' value='2091732297' />
<setting name='ProcessModel' value='InProcess' />
<setting name='DomainUsage' value='Single' />
<setting name='DefaultTestNamePattern' value='{m}{a}' />
<setting name='WorkDirectory' value='d:\repos\NUnit\nunitissues_otherrepos\Issue884\NUnitTestAdapterIssueRepro\bin\Debug\netcoreapp3.1' />
<setting name='NumberOfTestWorkers' value='28' />
</settings>
<properties>
<property name='_PID' value='36768' />
<property name='_APPDOMAIN' value='testhost' />
Expand Down Expand Up @@ -1159,6 +1149,34 @@ public void ThatSetUpFixtureWorksIssue884()
Assert.That(ndr, Is.Not.Null);
}

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'>
<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'>
<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' />
<properties>
<property name='_PID' value='90212' />
<property name='_APPDOMAIN' value='testhost' />
</properties>
<test-suite type='TestSuite' id='0-1005' name='Issue918' fullname='Issue918' runstate='Runnable' testcasecount='1'>
<test-suite type='GenericFixture' id='0-1003' name='Tests+SomeTest&lt;T&gt;' fullname='Issue918.Tests+SomeTest&lt;T&gt;' runstate='Runnable' testcasecount='1'>
<test-suite type='GenericFixture' id='0-1000' name='Tests+SomeTest&lt;T&gt;' fullname='Issue918.Tests+SomeTest&lt;T&gt;' runstate='Runnable' testcasecount='1'>
<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'>
<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' />
</test-suite>
</test-suite>
</test-suite>
</test-suite>
</test-suite>
</test-run>";

[Test]
public void ThatGenericFixturesWorksIssue918()
{
var sut = new DiscoveryConverter(logger, settings);
var ndr = sut.ConvertXml(
new NUnitResults(XmlHelper.CreateXmlNode(GenericIssue918)));
Assert.That(ndr, Is.Not.Null);
}


private const string ExtractFixturesHandlesProperties =
@"<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'>
Expand Down
3 changes: 1 addition & 2 deletions src/NUnitTestAdapterTests/ProjectTests.cs
@@ -1,5 +1,5 @@
// ***********************************************************************
// Copyright (c) 2011-2017 Charlie Poole, Terje Sandstrom
// Copyright (c) 2011-2017 Charlie Poole, 2014-2021 Terje Sandstrom
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand All @@ -23,7 +23,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;
using NUnit.Framework;

namespace NUnit.VisualStudio.TestAdapter.Tests
Expand Down