Skip to content

Commit 0445d70

Browse files
committed
Fix SetupHelpForTests
1 parent d00e07f commit 0445d70

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

PowerShellEditorServices.build.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ namespace Microsoft.PowerShell.EditorServices.Hosting
157157
}
158158

159159
Task SetupHelpForTests {
160-
if (-not (Get-Help Write-Host).Examples) {
160+
if (-not (Get-Help Microsoft.PowerShell.Management\Get-Process).Description) {
161161
Write-Host "Updating help for tests."
162-
Update-Help -Module Microsoft.PowerShell.Utility -Force -Scope CurrentUser
162+
Update-Help -Module Microsoft.PowerShell.Management,Microsoft.PowerShell.Utility -Force -Scope CurrentUser
163163
}
164164
}
165165

@@ -177,11 +177,11 @@ Task Build FindDotNet, CreateBuildInfo, {
177177

178178
Task Test TestServer, TestE2E, TestConstrainedLanguageMode
179179

180-
Task TestServer TestServerWinPS, TestServerPS72, TestServerPS73
180+
Task TestServer SetupHelpForTests, TestServerWinPS, TestServerPS72, TestServerPS73
181181

182-
Task TestE2E TestE2EPwsh, TestE2EWinPS
182+
Task TestE2E SetupHelpForTests, TestE2EPwsh, TestE2EWinPS
183183

184-
Task TestServerWinPS -If (-not $script:IsNix) Build, SetupHelpForTests, {
184+
Task TestServerWinPS -If (-not $script:IsNix) Build, {
185185
Set-Location .\test\PowerShellEditorServices.Test\
186186
# TODO: See https://github.com/dotnet/sdk/issues/18353 for x64 test host
187187
# that is debuggable! If architecture is added, the assembly path gets an
@@ -190,29 +190,29 @@ Task TestServerWinPS -If (-not $script:IsNix) Build, SetupHelpForTests, {
190190
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.Desktop }
191191
}
192192

193-
Task TestServerPS72 Build, SetupHelpForTests, {
193+
Task TestServerPS72 Build, {
194194
Set-Location .\test\PowerShellEditorServices.Test\
195195
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS72 }
196196
}
197197

198-
Task TestServerPS73 Build, SetupHelpForTests, {
198+
Task TestServerPS73 Build, {
199199
Set-Location .\test\PowerShellEditorServices.Test\
200200
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS73 }
201201
}
202202

203-
Task TestE2EPwsh Build, SetupHelpForTests, {
203+
Task TestE2EPwsh Build, {
204204
Set-Location .\test\PowerShellEditorServices.Test.E2E\
205205
$env:PWSH_EXE_NAME = "pwsh"
206206
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS73 }
207207
}
208208

209-
Task TestE2EWinPS -If (-not $script:IsNix) Build, SetupHelpForTests, {
209+
Task TestE2EWinPS -If (-not $script:IsNix) Build, {
210210
Set-Location .\test\PowerShellEditorServices.Test.E2E\
211211
$env:PWSH_EXE_NAME = "powershell"
212212
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetRuntime.PS73 }
213213
}
214214

215-
Task TestConstrainedLanguageMode -If (-not $script:IsNix) Build, SetupHelpForTests, {
215+
Task TestConstrainedLanguageMode -If (-not $script:IsNix) Build, {
216216
Set-Location .\test\PowerShellEditorServices.Test.E2E\
217217

218218
if (-not [Security.Principal.WindowsIdentity]::GetCurrent().Owner.IsWellKnown("BuiltInAdministratorsSid")) {

test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ await PsesLanguageClient
424424
Assert.NotNull(symInfoOrDocSym.DocumentSymbol);
425425
DocumentSymbol symbol = symInfoOrDocSym.DocumentSymbol;
426426

427-
Assert.Equal(symbol.Name, "function CanSendDocumentSymbolRequest ()");
428-
Assert.Equal(symbol.Kind, SymbolKind.Function);
427+
Assert.Equal("function CanSendDocumentSymbolRequest ()", symbol.Name);
428+
Assert.Equal(SymbolKind.Function, symbol.Kind);
429429

430430
Assert.Equal(1, symbol.Range.Start.Line);
431431
Assert.Equal(0, symbol.Range.Start.Character);
@@ -1033,6 +1033,7 @@ await PsesLanguageClient
10331033
public async Task CanSendCompletionAndCompletionResolveRequestAsync()
10341034
{
10351035
Skip.If(IsLinux, "This depends on the help system, which is flaky on Linux.");
1036+
Skip.If(PsesStdioProcess.IsWindowsPowerShell, "This help system isn't updated in CI.");
10361037
string filePath = NewTestFile("Write-H");
10371038

10381039
CompletionList completionItems = await PsesLanguageClient.TextDocument.RequestCompletion(
@@ -1123,6 +1124,7 @@ await PsesLanguageClient
11231124
public async Task CanSendHoverRequestAsync()
11241125
{
11251126
Skip.If(IsLinux, "This depends on the help system, which is flaky on Linux.");
1127+
Skip.If(PsesStdioProcess.IsWindowsPowerShell, "This help system isn't updated in CI.");
11261128
string filePath = NewTestFile("Write-Host");
11271129

11281130
Hover hover = await PsesLanguageClient.TextDocument.RequestHover(

tools/installPSResources.ps1

-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@ if ($PSVersionTable.PSVersion.Major -lt 6) {
1111
# TODO: Switch to Install-PSResource when CI uses PowerShell 7.4
1212
Install-Module -Name InvokeBuild -Scope CurrentUser
1313
Install-Module -Name platyPS -Scope CurrentUser
14-
15-
# Update help needed for tests.
16-
Update-Help -Module Microsoft.PowerShell*

0 commit comments

Comments
 (0)