From ea2ea94b627bb27990d99a9e3e106d2cb27804bd Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Sun, 19 Mar 2023 13:11:18 +0100 Subject: [PATCH 1/5] Added engine with fix for NUnit 4 (#1081) --- build.cake | 4 +- nuget.config | 2 +- src/NUnitTestAdapter/AdapterSettings.cs | 3 +- src/NUnitTestAdapter/NUnit.TestAdapter.csproj | 17 +++++-- .../{AssemblyInfo.cs => AssemblyInfoExtra.cs} | 14 +----- .../NUnit.TestAdapter.Tests.csproj | 4 +- .../NUnitEngineTests/NUnitDiscoveryTests.cs | 49 +++++++++++++++++-- 7 files changed, 66 insertions(+), 27 deletions(-) rename src/NUnitTestAdapter/Properties/{AssemblyInfo.cs => AssemblyInfoExtra.cs} (59%) diff --git a/build.cake b/build.cake index 1ca9b84b..8ee08347 100644 --- a/build.cake +++ b/build.cake @@ -13,9 +13,9 @@ var configuration = Argument("configuration", "Release"); ////////////////////////////////////////////////////////////////////// -var version = "4.4.2"; +var version = "4.5.0"; -var modifier = ""; +var modifier = "-alpha.3"; var dbgSuffix = configuration.ToLower() == "debug" ? "-dbg" : ""; diff --git a/nuget.config b/nuget.config index 01dd41bc..8f1bcc0a 100644 --- a/nuget.config +++ b/nuget.config @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/src/NUnitTestAdapter/AdapterSettings.cs b/src/NUnitTestAdapter/AdapterSettings.cs index e0b866cf..65cc94ce 100644 --- a/src/NUnitTestAdapter/AdapterSettings.cs +++ b/src/NUnitTestAdapter/AdapterSettings.cs @@ -712,7 +712,8 @@ public T MapEnum(string setting, T defaultValue) public enum ExplicitModeEnum { Strict, - Relaxed + Relaxed, + None } public enum OutputXmlFolderMode diff --git a/src/NUnitTestAdapter/NUnit.TestAdapter.csproj b/src/NUnitTestAdapter/NUnit.TestAdapter.csproj index 6f14e4d7..1c42cb4f 100644 --- a/src/NUnitTestAdapter/NUnit.TestAdapter.csproj +++ b/src/NUnitTestAdapter/NUnit.TestAdapter.csproj @@ -4,12 +4,21 @@ NUnit3.TestAdapter NUnit.VisualStudio.TestAdapter - + netcoreapp3.1 - net462;netcoreapp3.1 - false + + true https://github.com/nunit/nunit3-vs-adapter true + 4.5.0.0 + 4.5.0.0 + en + NUnit3 Test Adapter for Visual Studio + Copyright © 2011-2021 Charlie Poole, 2014-2023 Terje Sandstrom + A package containing the NUnit3 TestAdapter for Visual Studio 2012 onwards. + The package works with Visual Studio 2012 and newer, dotnet test and VSTest.Console. + NUnit Project + NUnit3TestAdapter @@ -24,7 +33,7 @@ - + diff --git a/src/NUnitTestAdapter/Properties/AssemblyInfo.cs b/src/NUnitTestAdapter/Properties/AssemblyInfoExtra.cs similarity index 59% rename from src/NUnitTestAdapter/Properties/AssemblyInfo.cs rename to src/NUnitTestAdapter/Properties/AssemblyInfoExtra.cs index 528247a1..ba1a2c80 100644 --- a/src/NUnitTestAdapter/Properties/AssemblyInfo.cs +++ b/src/NUnitTestAdapter/Properties/AssemblyInfoExtra.cs @@ -4,24 +4,14 @@ using System; using System.Reflection; -using System.Resources; using System.Runtime.CompilerServices; 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. \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-2023 Terje Sandstrom")] +// See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props for which properties are in the csproj and which are not. + [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: CLSCompliant(false)] -[assembly: NeutralResourcesLanguage("en-US")] - [assembly: ComVisible(false)] - [assembly: Guid("c0aad5e4-b486-49bc-b3e8-31e01be6fefe")] -[assembly: AssemblyVersion("4.4.0.0")] -[assembly: AssemblyFileVersion("4.4.0.0")] - [assembly: InternalsVisibleTo("NUnit.VisualStudio.TestAdapter.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010029b97dea816272cc4ea44cf3cf666f8150d6dfe1274b6c2e6c4d54259b756888ec08ad6dd3ea0f540b30408b948ae5f39cf0c7b210abdec267b367ce1eccab97d5c6c02ee67090827ffd699544fa2add4849b45a1901eac08495bfee0397fba3946ff3912ce0b9a497818e418a77a0c8db4ca1780e7b6f6dd6911395fcc0faba")] diff --git a/src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj b/src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj index 3708c5ee..50dd3106 100644 --- a/src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj +++ b/src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj @@ -4,8 +4,8 @@ true NUnit.VisualStudio.TestAdapter.Tests NUnit.VisualStudio.TestAdapter.Tests - net462;netcoreapp3.1 - + + netcoreapp3.1 true true diff --git a/src/NUnitTestAdapterTests/NUnitEngineTests/NUnitDiscoveryTests.cs b/src/NUnitTestAdapterTests/NUnitEngineTests/NUnitDiscoveryTests.cs index 92eb8b5a..5db9b5fb 100644 --- a/src/NUnitTestAdapterTests/NUnitEngineTests/NUnitDiscoveryTests.cs +++ b/src/NUnitTestAdapterTests/NUnitEngineTests/NUnitDiscoveryTests.cs @@ -1,6 +1,8 @@ using System.Linq; using System.Xml; + using NSubstitute; + using NUnit.Framework; using NUnit.VisualStudio.TestAdapter.NUnitEngine; // ReSharper disable StringLiteralTypo @@ -1007,17 +1009,54 @@ public void ThatDotNetTestWorks() "; - [Test] - public void ThatMixedExplicitTestSourceWorksFor312() + /// + /// See issue 1041 at https://github.com/nunit/nunit3-vs-adapter/issues/1044 + /// + private const string MixedExplicitTestSourceXmlForIssue1041 = + @" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + + [TestCase(MixedExplicitTestSourceXmlForIssue1041, 2, 4)] + [TestCase(MixedExplicitTestSourceXmlForNUnit312, 1, 3)] + public void ThatMixedExplicitTestSourceWorks(string xml, int expectedRunnable, int expectedAll) { var sut = new DiscoveryConverter(logger, settings); var ndr = sut.ConvertXml( - new NUnitResults(XmlHelper.CreateXmlNode(MixedExplicitTestSourceXmlForNUnit312))); + new NUnitResults(XmlHelper.CreateXmlNode(xml))); Assert.Multiple(() => { Assert.That(ndr.IsExplicit, Is.False, "Explicit check fails"); - Assert.That(ndr.TestAssembly.RunnableTestCases.Count, Is.EqualTo(1), "Runnable number fails"); - Assert.That(ndr.TestAssembly.AllTestCases.Count, Is.EqualTo(3), "Can't find all testcases"); + Assert.That(ndr.TestAssembly.RunnableTestCases.Count, Is.EqualTo(expectedRunnable), "Runnable number fails"); + Assert.That(ndr.TestAssembly.AllTestCases.Count, Is.EqualTo(expectedAll), "Can't find all testcases"); }); } From 2ff5a82b88e0c6145e33d155c1443c95e2999476 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Mar 2023 14:13:19 +0100 Subject: [PATCH 2/5] Bump NUnit.Analyzers from 3.6.0 to 3.6.1 (#1077) Bumps [NUnit.Analyzers](https://github.com/nunit/nunit.analyzers) from 3.6.0 to 3.6.1. - [Release notes](https://github.com/nunit/nunit.analyzers/releases) - [Changelog](https://github.com/nunit/nunit.analyzers/blob/master/CHANGES.txt) - [Commits](https://github.com/nunit/nunit.analyzers/compare/3.6.0...3.6.1) --- updated-dependencies: - dependency-name: NUnit.Analyzers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../NUnit.TestAdapter.Tests.Acceptance.csproj | 2 +- src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj b/src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj index 066c0be3..012369f7 100644 --- a/src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj +++ b/src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj b/src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj index 50dd3106..296f0161 100644 --- a/src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj +++ b/src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj @@ -16,7 +16,7 @@ - + From 7de239310efd7787ddf798753da6db9e3d622327 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Mar 2023 14:15:08 +0100 Subject: [PATCH 3/5] Bump Microsoft.NET.Test.Sdk from 17.4.0 to 17.5.0 (#1059) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.4.0 to 17.5.0. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.4.0...v17.5.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Terje Sandstrom From 49c72b57969ef6ce6df7622b4df0354399da6265 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Mar 2023 14:16:41 +0100 Subject: [PATCH 4/5] Bump actions/checkout from 3.3.0 to 3.4.0 (#1079) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3.3.0...v3.4.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Terje Sandstrom --- .github/workflows/NUnit3TestAdapter.Cake.CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/NUnit3TestAdapter.Cake.CI.yml b/.github/workflows/NUnit3TestAdapter.Cake.CI.yml index 800f14fb..0956419c 100644 --- a/.github/workflows/NUnit3TestAdapter.Cake.CI.yml +++ b/.github/workflows/NUnit3TestAdapter.Cake.CI.yml @@ -8,7 +8,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3.3.0 + - uses: actions/checkout@v3.4.0 - uses: actions/setup-dotnet@v2 with: dotnet-version: | From 364f81edf042c06c401513b279d012e09533f668 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Mar 2023 14:17:09 +0100 Subject: [PATCH 5/5] Bump NUnit3TestAdapter from 4.4.0 to 4.4.2 (#1075) Bumps [NUnit3TestAdapter](https://github.com/nunit/nunit3-vs-adapter) from 4.4.0 to 4.4.2. - [Release notes](https://github.com/nunit/nunit3-vs-adapter/releases) - [Commits](https://github.com/nunit/nunit3-vs-adapter/compare/V4.4.0...V4.4.2) --- updated-dependencies: - dependency-name: NUnit3TestAdapter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Terje Sandstrom --- .../NUnit.TestAdapter.Tests.Acceptance.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj b/src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj index 012369f7..46950c1d 100644 --- a/src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj +++ b/src/NUnit.TestAdapter.Tests.Acceptance/NUnit.TestAdapter.Tests.Acceptance.csproj @@ -11,7 +11,7 @@ - +