From f05ca2fd85a4d0205753a63db61a14ae169e07b5 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 2 Apr 2025 10:51:19 +0200 Subject: [PATCH 1/3] Downgrage xUnit v3 to 1.1.0 --- tests/Elastic.Markdown.Tests/Elastic.Markdown.Tests.csproj | 2 +- tests/authoring/authoring.fsproj | 2 +- .../src/docs-assembler.Tests/GlobalNavigationTests.cs | 3 ++- .../src/docs-assembler.Tests/docs-assembler.Tests.csproj | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Elastic.Markdown.Tests/Elastic.Markdown.Tests.csproj b/tests/Elastic.Markdown.Tests/Elastic.Markdown.Tests.csproj index 2af907ea6..febdaead8 100644 --- a/tests/Elastic.Markdown.Tests/Elastic.Markdown.Tests.csproj +++ b/tests/Elastic.Markdown.Tests/Elastic.Markdown.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/tests/authoring/authoring.fsproj b/tests/authoring/authoring.fsproj index bcea2e66c..4eff5575f 100644 --- a/tests/authoring/authoring.fsproj +++ b/tests/authoring/authoring.fsproj @@ -13,7 +13,7 @@ - + diff --git a/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs b/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs index 2b91bfa12..fef104ad4 100644 --- a/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs +++ b/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs @@ -25,9 +25,10 @@ public class GlobalNavigationPathProviderTests public GlobalNavigationPathProviderTests() { FileSystem = new FileSystem(); - CheckoutDirectory = FileSystem.DirectoryInfo.New( + var checkoutDirectory = FileSystem.DirectoryInfo.New( FileSystem.Path.Combine(Paths.GetSolutionDirectory()!.FullName, ".artifacts", "checkouts") ); + CheckoutDirectory = checkoutDirectory.GetDirectories().First(d => d.Name is "next" or "current"); Collector = new DiagnosticsCollector([]); Context = new AssembleContext("dev", Collector, FileSystem, FileSystem, CheckoutDirectory.FullName, null); } diff --git a/tests/docs-assembler.Tests/src/docs-assembler.Tests/docs-assembler.Tests.csproj b/tests/docs-assembler.Tests/src/docs-assembler.Tests/docs-assembler.Tests.csproj index 3cb655b6e..af32039d1 100644 --- a/tests/docs-assembler.Tests/src/docs-assembler.Tests/docs-assembler.Tests.csproj +++ b/tests/docs-assembler.Tests/src/docs-assembler.Tests/docs-assembler.Tests.csproj @@ -17,7 +17,7 @@ - + From 89fae8efa5188e8ad9276da7a1eab421bb1a8f49 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 2 Apr 2025 10:58:29 +0200 Subject: [PATCH 2/3] Fix skipunless --- .../src/docs-assembler.Tests/GlobalNavigationTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs b/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs index fef104ad4..804f7bfdc 100644 --- a/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs +++ b/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs @@ -28,7 +28,7 @@ public GlobalNavigationPathProviderTests() var checkoutDirectory = FileSystem.DirectoryInfo.New( FileSystem.Path.Combine(Paths.GetSolutionDirectory()!.FullName, ".artifacts", "checkouts") ); - CheckoutDirectory = checkoutDirectory.GetDirectories().First(d => d.Name is "next" or "current"); + CheckoutDirectory = checkoutDirectory.GetDirectories().FirstOrDefault(d => d.Name is "next" or "current") ?? checkoutDirectory; Collector = new DiagnosticsCollector([]); Context = new AssembleContext("dev", Collector, FileSystem, FileSystem, CheckoutDirectory.FullName, null); } @@ -64,6 +64,8 @@ private async Task Setup() [Fact] public async Task ReadAllPathPrefixes() { + Assert.SkipUnless(HasCheckouts(), $"Requires local checkout folder: {CheckoutDirectory.FullName}"); + await using var collector = new DiagnosticsCollector([]); var assembleContext = new AssembleContext("dev", collector, new FileSystem(), new FileSystem(), null, null); From 603780962b5a2265f9c946c1a89c6a3a7c007fcf Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 2 Apr 2025 11:02:39 +0200 Subject: [PATCH 3/3] Fix skipunless --- .../src/docs-assembler.Tests/GlobalNavigationTests.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs b/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs index 804f7bfdc..25054c581 100644 --- a/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs +++ b/tests/docs-assembler.Tests/src/docs-assembler.Tests/GlobalNavigationTests.cs @@ -28,7 +28,9 @@ public GlobalNavigationPathProviderTests() var checkoutDirectory = FileSystem.DirectoryInfo.New( FileSystem.Path.Combine(Paths.GetSolutionDirectory()!.FullName, ".artifacts", "checkouts") ); - CheckoutDirectory = checkoutDirectory.GetDirectories().FirstOrDefault(d => d.Name is "next" or "current") ?? checkoutDirectory; + CheckoutDirectory = checkoutDirectory.Exists + ? checkoutDirectory.GetDirectories().FirstOrDefault(d => d.Name is "next" or "current") ?? checkoutDirectory + : checkoutDirectory; Collector = new DiagnosticsCollector([]); Context = new AssembleContext("dev", Collector, FileSystem, FileSystem, CheckoutDirectory.FullName, null); }