From 7d92b4ab86281d8f041d79c1b01018c98a211286 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:02:28 -0600 Subject: [PATCH 1/7] Bump xunit.runner.visualstudio from 2.4.5 to 2.5.0 (#210) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.4.5 to 2.5.0. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/v2.4.5...2.5.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio 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> --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c15928bee..3ac312f9d 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,7 +6,7 @@ - + From 4822f178831d771c1d28288703651b687e22f593 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 15:07:54 -0600 Subject: [PATCH 2/7] Bump MicroBuildVersion to 2.0.131 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 250a08a52..e58842843 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,7 +4,7 @@ true true - 2.0.130 + 2.0.131 From 2e19c89761d8d7f934250f4effca22136c48cf39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 21:08:52 +0000 Subject: [PATCH 3/7] Bump xunit from 2.4.2 to 2.5.0 (#209) --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 3ac312f9d..6af95c882 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -7,7 +7,7 @@ - + From 75b0953f6e91e66076030f20fa0bc4a2990ad906 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 15:25:18 -0600 Subject: [PATCH 4/7] Remove `tool run` from `dotnet nbgv` invocation I have an Azure Pipeline where `InsertVersionsValues.ps1` (in the microbuild branch) works but this step fails, and the only difference is that one omits `tool run` from `dotnet nbgv`. I continue to believe this is a bug in the `dotnet tool` command. --- azure-pipelines/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 2e2f426e0..9c445f727 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -17,7 +17,7 @@ jobs: clean: true - template: install-dependencies.yml - - script: dotnet tool run nbgv cloud -c + - script: dotnet nbgv cloud -c displayName: ⚙ Set build number - template: dotnet.yml From 442ca7c6e521a55a39351b9ef3a3b81207fa4ef5 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 16:12:43 -0600 Subject: [PATCH 5/7] Dependabot to ignore dotnet-format --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 63e3e890b..484f2bfcd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,7 @@ updates: directory: / schedule: interval: weekly + ignore: + # This package has unlisted versions on nuget.org that are not supported. Avoid them. + - dependency-name: dotnet-format + versions: ["6.x", "7.x", "8.x"] From 1b398c525be990076d0f67484e91781c4cf6fa55 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 16:23:37 -0600 Subject: [PATCH 6/7] Bump xunit to 2.5.0 --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 72f9d1925..6d283cb2b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -36,8 +36,8 @@ - - + + From c21fd26db7231c89eaebe44551beecc905e4247c Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 10 Jul 2023 16:41:32 -0600 Subject: [PATCH 7/7] Fix failures after updating xunit --- .../AttributedPartDiscoveryTestBase.cs | 4 ++-- .../ComposableCatalogTests2.cs | 4 ++-- .../CompositionFailedExceptionTests.cs | 2 +- .../DisposablePartsTests.cs | 4 ++-- .../ExportingMembersTests.cs | 2 +- .../FaultyPartsTests.cs | 2 +- .../ImportManyTests.cs | 4 ++-- .../InvalidGraphTests.cs | 4 ++-- .../LazyImportTests.cs | 2 +- .../RejectionTests.cs | 2 +- .../SharingBoundaryInvalidTests.cs | 2 +- .../SharingBoundaryWithSharedTests.cs | 2 +- .../XunitExtensions/LegacyMefTestCaseRunner.cs | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/Microsoft.VisualStudio.Composition.Tests/AttributedPartDiscoveryTestBase.cs b/test/Microsoft.VisualStudio.Composition.Tests/AttributedPartDiscoveryTestBase.cs index 0505274f8..350f332b9 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/AttributedPartDiscoveryTestBase.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/AttributedPartDiscoveryTestBase.cs @@ -24,7 +24,7 @@ public void NonSharedPartProduction() { ComposablePartDefinition? result = this.DiscoveryService.CreatePart(typeof(NonSharedPart)); Assert.NotNull(result); - Assert.Equal(1, result!.ExportedTypes.Count); + Assert.Single(result!.ExportedTypes); Assert.Empty(result.ImportingMembers); Assert.False(result.IsShared); } @@ -34,7 +34,7 @@ public void SharedPartProduction() { ComposablePartDefinition? result = this.DiscoveryService.CreatePart(typeof(SharedPart)); Assert.NotNull(result); - Assert.Equal(1, result!.ExportedTypes.Count); + Assert.Single(result!.ExportedTypes); Assert.Empty(result.ImportingMembers); Assert.True(result.IsShared); } diff --git a/test/Microsoft.VisualStudio.Composition.Tests/ComposableCatalogTests2.cs b/test/Microsoft.VisualStudio.Composition.Tests/ComposableCatalogTests2.cs index 3c620c2ed..add040777 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/ComposableCatalogTests2.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/ComposableCatalogTests2.cs @@ -50,7 +50,7 @@ public async Task CreateFromTypesOmitsNonParts(PartDiscovery discovery) { var catalog = ComposableCatalog.Create(discovery.Resolver).AddParts( await discovery.CreatePartsAsync(typeof(NonExportingType), typeof(ExportingType))); - Assert.Equal(1, catalog.Parts.Count); + Assert.Single(catalog.Parts); Assert.Equal(typeof(ExportingType), catalog.Parts.Single().Type); } @@ -63,7 +63,7 @@ public void AddPartNullThrows() [Fact] public void GetAssemblyInputs_Empty() { - Assert.Equal(0, TestUtilities.EmptyCatalog.GetInputAssemblies().Count); + Assert.Empty(TestUtilities.EmptyCatalog.GetInputAssemblies()); } [Theory] diff --git a/test/Microsoft.VisualStudio.Composition.Tests/CompositionFailedExceptionTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/CompositionFailedExceptionTests.cs index 18f6636e5..1ffc55132 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/CompositionFailedExceptionTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/CompositionFailedExceptionTests.cs @@ -26,7 +26,7 @@ public void ExceptionIsSerializable() try { configuration.ThrowOnErrors(); - Assert.True(false, "Expected exception not thrown."); + Assert.Fail("Expected exception not thrown."); } catch (CompositionFailedException ex) { diff --git a/test/Microsoft.VisualStudio.Composition.Tests/DisposablePartsTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/DisposablePartsTests.cs index 0574038d9..2df176770 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/DisposablePartsTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/DisposablePartsTests.cs @@ -147,7 +147,7 @@ public class UninstantiatedNonSharedPart : IDisposable { public UninstantiatedNonSharedPart() { - Assert.False(true, "This should never be instantiated."); + Assert.Fail("This should never be instantiated."); } public void Dispose() @@ -176,7 +176,7 @@ public void PartDisposedWhenThrows(IContainer container) try { container.GetExportedValue(); - Assert.False(true, "An exception should have been thrown."); + Assert.Fail("An exception should have been thrown."); } catch { } diff --git a/test/Microsoft.VisualStudio.Composition.Tests/ExportingMembersTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/ExportingMembersTests.cs index bcf12f8aa..77b0ce8e2 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/ExportingMembersTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/ExportingMembersTests.cs @@ -150,7 +150,7 @@ public void ExportedMethodFuncOf2WrongTypeArgs(IContainer container) try { container.GetExportedValue>("Method"); - Assert.False(true, "Expected exception not thrown."); + Assert.Fail("Expected exception not thrown."); } catch (MefV1.ImportCardinalityMismatchException) { } catch (Microsoft.VisualStudio.Composition.CompositionFailedException) { } // V2/V3 diff --git a/test/Microsoft.VisualStudio.Composition.Tests/FaultyPartsTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/FaultyPartsTests.cs index 5ec33ae94..78116c92e 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/FaultyPartsTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/FaultyPartsTests.cs @@ -310,7 +310,7 @@ private static void AssertThrowsV1(Func action) try { action(); - Assert.False(true, "Expected exception not thrown."); + Assert.Fail("Expected exception not thrown."); } catch (CompositionFailedException ex) { diff --git a/test/Microsoft.VisualStudio.Composition.Tests/ImportManyTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/ImportManyTests.cs index fb9325d78..e345cc683 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/ImportManyTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/ImportManyTests.cs @@ -103,7 +103,7 @@ public void ImportManyIListWithNone(IContainer container) var extendable = container.GetExportedValue(); Assert.NotNull(extendable); Assert.NotNull(extendable.Extensions); - Assert.Equal(0, extendable.Extensions.Count); + Assert.Empty(extendable.Extensions); } [MefFact(CompositionEngines.V2Compat, typeof(ExtendableIList), typeof(ExtensionOne))] @@ -112,7 +112,7 @@ public void ImportManyIListWithOne(IContainer container) var extendable = container.GetExportedValue(); Assert.NotNull(extendable); Assert.NotNull(extendable.Extensions); - Assert.Equal(1, extendable.Extensions.Count); + Assert.Single(extendable.Extensions); Assert.IsAssignableFrom(extendable.Extensions.Single()); } diff --git a/test/Microsoft.VisualStudio.Composition.Tests/InvalidGraphTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/InvalidGraphTests.cs index c123768f8..507d23a19 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/InvalidGraphTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/InvalidGraphTests.cs @@ -135,7 +135,7 @@ public void UncreatableLazyImportedPartV1(IContainer container) try { var throws = part.ImportOfUncreatablePart.Value; - Assert.False(true, "Expected exception not thrown."); + Assert.Fail("Expected exception not thrown."); } catch (CompositionFailedException) { } catch (MefV1.CompositionException) { } @@ -187,7 +187,7 @@ public void UncreatableLazyImportedPartWithImportingPropertyV1(IContainer contai try { var throws = part.LazyImportOfUncreatablePart.Value; - Assert.False(true, "Expected exception not thrown."); + Assert.Fail("Expected exception not thrown."); } catch (CompositionFailedException) { } catch (MefV1.CompositionException) { } diff --git a/test/Microsoft.VisualStudio.Composition.Tests/LazyImportTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/LazyImportTests.cs index d5c4224f2..35ce6c374 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/LazyImportTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/LazyImportTests.cs @@ -72,7 +72,7 @@ public class ExportWithLazyImportOfBaseType public void LazyImportMany(IContainer container) { var lazyImport = container.GetExportedValue(); - Assert.Equal(1, lazyImport.AnotherExports.Count); + Assert.Single(lazyImport.AnotherExports); Assert.Equal(0, AnotherExport.ConstructionCount); Assert.False(lazyImport.AnotherExports[0].IsValueCreated); AnotherExport anotherExport = lazyImport.AnotherExports[0].Value; diff --git a/test/Microsoft.VisualStudio.Composition.Tests/RejectionTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/RejectionTests.cs index 26772e35b..7e5cddc92 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/RejectionTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/RejectionTests.cs @@ -75,7 +75,7 @@ public void LazyImportOfPartWithMissingImportingConstructor(IContainer container try { var expectFailure = exports[0].ImportOfBrokenPart.Value; - Assert.False(true, "Some type of composition exception was expected here."); + Assert.Fail("Some type of composition exception was expected here."); } catch (CompositionFailedException) { diff --git a/test/Microsoft.VisualStudio.Composition.Tests/SharingBoundaryInvalidTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/SharingBoundaryInvalidTests.cs index 98136fe34..d42713bf3 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/SharingBoundaryInvalidTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/SharingBoundaryInvalidTests.cs @@ -33,7 +33,7 @@ public void InvalidImportAcrossSharingBoundary(IContainer container) // But that's not really a tenable prospect and it's harder to reason over anyway. // It makes sense that MEFv2 didn't allow this. root.Factory.CreateExport(); - Assert.False(true, "Expected exception not thrown."); + Assert.Fail("Expected exception not thrown."); } catch (CompositionFailedException) { } catch (System.Composition.Hosting.CompositionFailedException) { } diff --git a/test/Microsoft.VisualStudio.Composition.Tests/SharingBoundaryWithSharedTests.cs b/test/Microsoft.VisualStudio.Composition.Tests/SharingBoundaryWithSharedTests.cs index 8746799ac..7a42e1239 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/SharingBoundaryWithSharedTests.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/SharingBoundaryWithSharedTests.cs @@ -171,7 +171,7 @@ public class SharedRootPartOnlyImportedFromChildScope { public SharedRootPartOnlyImportedFromChildScope() { - Assert.False(true, "This type should ever be constructed. It should be imported lazily and never constructed as part of a GC test."); + Assert.Fail("This type should ever be constructed. It should be imported lazily and never constructed as part of a GC test."); } } diff --git a/test/Microsoft.VisualStudio.Composition.Tests/XunitExtensions/LegacyMefTestCaseRunner.cs b/test/Microsoft.VisualStudio.Composition.Tests/XunitExtensions/LegacyMefTestCaseRunner.cs index 7d337c716..f5e169b7e 100644 --- a/test/Microsoft.VisualStudio.Composition.Tests/XunitExtensions/LegacyMefTestCaseRunner.cs +++ b/test/Microsoft.VisualStudio.Composition.Tests/XunitExtensions/LegacyMefTestCaseRunner.cs @@ -126,7 +126,7 @@ public bool QueueMessage(IMessageSinkMessage message) else if (message is TestPassed) { var passedMessage = (TestPassed)message; - message = new TestFailed(passedMessage.Test, passedMessage.ExecutionTime, passedMessage.Output, new AssertActualExpectedException(false, true, "Expected invalid configuration but no exception thrown.")); + message = new TestFailed(passedMessage.Test, passedMessage.ExecutionTime, passedMessage.Output, new XunitException("Expected invalid configuration but no exception thrown.")); this.InvertedSuccesses++; } }