Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple integration test, with an LSP client PowerShell module #944

Merged
merged 47 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c708a1b
Add first parts of ps pses client
Apr 19, 2019
e36001a
Make message reading work
Apr 19, 2019
9e67dea
Start pipe module
rjmholt Apr 22, 2019
b66a9ac
Add simple startup test
rjmholt Apr 22, 2019
6711016
Add shutdown test
rjmholt Apr 22, 2019
be4587e
Add pester installation to build step
rjmholt Apr 22, 2019
2158e3b
Response to Codacy bot's feedback
rjmholt Apr 22, 2019
4952bad
Add classes and types to psm1
rjmholt Apr 22, 2019
7ba21c2
Fix build logic, add return types
rjmholt Apr 23, 2019
558abc0
Rename pester test file to be more specific
rjmholt Apr 23, 2019
5c35561
Kill process properly
rjmholt Apr 23, 2019
81631a1
Fix process kill
rjmholt Apr 23, 2019
adcb527
Add diagnostic line;
rjmholt Apr 23, 2019
b16429d
Attempt to exit
rjmholt Apr 23, 2019
0435cb6
Add some documentation comments
rjmholt Apr 24, 2019
7e9a76d
Ensure pipe is closed during disposal
rjmholt Apr 24, 2019
9b66b61
Fix pipe disposal
rjmholt Apr 24, 2019
d949558
Change cancellation method
rjmholt Apr 24, 2019
b061b65
Try invoking pester in proc
rjmholt Apr 25, 2019
6b13e22
Add doc comments
rjmholt Apr 25, 2019
29ccd29
Use better exceptions
rjmholt Apr 25, 2019
2896933
Comply with some of Codacy's draconian views
rjmholt Apr 25, 2019
7b3ee70
Publish Pester results in CI
rjmholt Apr 26, 2019
5a2b3d0
Remove .vscode folder
rjmholt Apr 26, 2019
3bb6df4
Merge branch 'master' into integration-tools
rjmholt Apr 26, 2019
228b5eb
Fix typo
rjmholt Apr 26, 2019
516cbb0
Fix NRE in test
rjmholt Apr 26, 2019
beeef02
Improve client module building
rjmholt Apr 26, 2019
dae7511
Pass through dotnet location
rjmholt Apr 26, 2019
f8654d6
Ensure new enough Pester is installed
rjmholt Apr 26, 2019
14b8884
Add -Force flag
rjmholt Apr 26, 2019
4069a40
Update tools/PsesPsClient/PsesPsClient.psd1
TylerLeonhardt Apr 30, 2019
a6e2e99
Rework module, address @TylerLeonhardt's feedback
rjmholt Apr 30, 2019
e8529dd
Update PowerShellEditorServices.build.ps1
TylerLeonhardt May 3, 2019
b0d704c
Update tools/PsesPsClient/Client.cs
rjmholt May 9, 2019
1b90683
Add server output to integration test
May 14, 2019
c0bcefb
Try stderr recording
May 14, 2019
d9b3a0b
Try procinfo
May 14, 2019
c48b586
Don't use stream when it doesn't exist
May 14, 2019
e2e3c9b
Try again with error file
May 14, 2019
a7e599c
Use log parser to find errors
May 14, 2019
47cdb90
Add test exception for pwsh pipe close error
May 14, 2019
d5a67c2
Improve error message
May 14, 2019
dc2506e
Test without skipping crash log exception
May 15, 2019
135d47d
Try ending server stream first
May 15, 2019
37ddedf
Improve testing
May 15, 2019
9f5666f
Add comments about test ordering
May 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Try again with error file
  • Loading branch information
Robert Holt committed May 14, 2019
commit e2e3c9b8f35ba19b45fc9f2645b1de986f9b4bf2
4 changes: 2 additions & 2 deletions test/Pester/EditorServices.Integration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ Describe "Loading and running PowerShellEditorServices" {

$stderrFile = [System.IO.Path]::GetTempFileName()

$psesServer = Start-PsesServer -RetainOutput
$psesServer = Start-PsesServer -ErrorFile $stderrFile
$client = Connect-PsesServer -PipeName $psesServer.SessionDetails.languageServicePipeName
}

AfterAll {
$errs = if ($psesServer.StandardError) { $psesServer.StandardError.ReadToEnd() }
$errs = if (Test-Path $stderrFile) { Get-Content -Raw $stderrFile }

if ($errs)
{
Expand Down
27 changes: 11 additions & 16 deletions tools/PsesPsClient/PsesPsClient.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ function Start-PsesServer
$EnableConsoleRepl,

[Parameter()]
[switch]
$RetainOutput
[string]
$ErrorFile
)

$EditorServicesPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($EditorServicesPath)
Expand Down Expand Up @@ -142,24 +142,19 @@ function Start-PsesServer
$startPsesCommand
)

if ($RetainOutput)
{
$serverProcess = [System.Diagnostics.Process]@{
StartInfo = [System.Diagnostics.ProcessStartInfo]@{
FileName = $pwshPath
RedirectStandardOutput = $true
RedirectStandardError = $true
UseShellExecute = $false
Arguments = ($startArgs -join ' ').Replace("'", "'''")
}
}
$serverProcess.Start()
$startProcParams = @{
PassThru = $true
FilePath = $pwshPath
ArgumentList = $startArgs
}
else

if ($ErrorFile)
{
$serverProcess = Start-Process -PassThru -FilePath $pwshPath -ArgumentList $startArgs
$startProcParams.RedirectStandardError = $ErrorFile
}

$serverProcess = Start-Process @startProcParams

$sessionPath = $editorServicesOptions.SessionDetailsPath

$i = 0
Expand Down