Skip to content

Commit bc2db5c

Browse files
committed
Skip tests which depend on help system and so are flaky on Linux
1 parent ccba0d3 commit bc2db5c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/PowerShellEditorServices/Utility/VersionUtils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ internal static class VersionUtils
5050
public static bool IsPS7OrGreater { get; } = PSVersion.Major >= 7;
5151

5252
/// <summary>
53-
/// True if we are running in on Windows, false otherwise.
53+
/// True if we are running on Windows, false otherwise.
5454
/// </summary>
5555
public static bool IsWindows { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
5656

5757
/// <summary>
58-
/// True if we are running in on macOS, false otherwise.
58+
/// True if we are running on macOS, false otherwise.
5959
/// </summary>
6060
public static bool IsMacOS { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
6161

6262
/// <summary>
63-
/// True if we are running in on Linux, false otherwise.
63+
/// True if we are running on Linux, false otherwise.
6464
/// </summary>
6565
public static bool IsLinux { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
6666
}

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.IO;
1010
using System.Linq;
1111
using System.Reflection;
12+
using System.Runtime.InteropServices;
1213
using System.Text;
1314
using System.Threading;
1415
using System.Threading.Tasks;
@@ -31,6 +32,9 @@ namespace PowerShellEditorServices.Test.E2E
3132
{
3233
public class LanguageServerProtocolMessageTests : IClassFixture<LSPTestsFixture>, IDisposable
3334
{
35+
// Borrowed from `VersionUtils` which can't be used here due to an initialization problem.
36+
private static bool IsLinux { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
37+
3438
private readonly static string s_binDir =
3539
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
3640

@@ -924,9 +928,10 @@ await PsesLanguageClient
924928
}
925929

926930
[Trait("Category", "LSP")]
927-
[Fact]
931+
[SkippableFact]
928932
public async Task CanSendCompletionAndCompletionResolveRequestAsync()
929933
{
934+
Skip.If(IsLinux, "This depends on the help system, which is flaky on Linux.");
930935
string filePath = NewTestFile("Write-H");
931936

932937
CompletionList completionItems = await PsesLanguageClient.TextDocument.RequestCompletion(
@@ -950,9 +955,10 @@ public async Task CanSendCompletionAndCompletionResolveRequestAsync()
950955
}
951956

952957
[Trait("Category", "LSP")]
953-
[Fact]
958+
[SkippableFact]
954959
public async Task CanSendCompletionResolveWithModulePrefixRequestAsync()
955960
{
961+
Skip.If(IsLinux, "This depends on the help system, which is flaky on Linux.");
956962
await PsesLanguageClient
957963
.SendRequest<EvaluateRequestArguments>(
958964
"evaluate",
@@ -985,9 +991,10 @@ await PsesLanguageClient
985991
}
986992

987993
[Trait("Category", "LSP")]
988-
[Fact]
994+
[SkippableFact]
989995
public async Task CanSendHoverRequestAsync()
990996
{
997+
Skip.If(IsLinux, "This depends on the help system, which is flaky on Linux.");
991998
string filePath = NewTestFile("Write-Host");
992999

9931000
Hover hover = await PsesLanguageClient.TextDocument.RequestHover(

0 commit comments

Comments
 (0)