Skip to content

Commit

Permalink
Skip test that's too slow in ADO (#2220)
Browse files Browse the repository at this point in the history
And remove test that's no longer run since <7.4 has been dropped.
  • Loading branch information
andyleejordan authored Feb 26, 2025
1 parent 601666f commit 0af8424
Showing 1 changed file with 4 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1057,44 +1057,6 @@ public async Task CanSendCompletionAndCompletionResolveRequestAsync()
Assert.Contains("Writes customized output to a host", updatedCompletionItem.Documentation.String);
}

// Regression test for https://github.com/PowerShell/PowerShellEditorServices/issues/1926
[SkippableFact]
public async Task CanRequestCompletionsAndHandleExceptions()
{
PowerShellVersion details
= await PsesLanguageClient
.SendRequest("powerShell/getVersion", new GetVersionParams())
.Returning<PowerShellVersion>(CancellationToken.None);

Skip.IfNot(details.Version.StartsWith("7.2") || details.Version.StartsWith("7.3"),
"This is a bug in PowerShell 7.2 and 7.3, fixed in 7.4");

string filePath = NewTestFile(@"
@() | ForEach-Object {
if ($false) {
return
}
@{key=$}
}");

Messages.Clear(); // On some systems there's a warning message about configuration items too.
CompletionList completionItems = await PsesLanguageClient.TextDocument.RequestCompletion(
new CompletionParams
{
TextDocument = new TextDocumentIdentifier
{
Uri = DocumentUri.FromFileSystemPath(filePath)
},
Position = new Position(line: 6, character: 11)
});

Assert.Empty(completionItems);
Assert.Collection(Messages,
(message) => Assert.Contains("Error Occurred in TabExpansion2", message.Message),
(message) => Assert.Contains("Exception occurred while running handling completion request", message.Message));
}

[SkippableFact(Skip = "Completion for Expand-SlowArchive is flaky.")]
public async Task CanSendCompletionResolveWithModulePrefixRequestAsync()
{
Expand Down Expand Up @@ -1269,9 +1231,12 @@ await PsesLanguageClient
Assert.Equal(0, evaluateResponseBody.VariablesReference);
}

[Fact]
[SkippableFact]
public async Task CanSendGetCommandRequestAsync()
{
Skip.If(Environment.GetEnvironmentVariable("TF_BUILD") is not null,
"This test is too slow in CI.");

List<object> pSCommandMessages =
await PsesLanguageClient
.SendRequest("powerShell/getCommand", new GetCommandParams())
Expand Down

0 comments on commit 0af8424

Please sign in to comment.