Skip to content

WIP: Test cherry pick #1801

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
88cabc4
Do not run pester tests when user cancels questions using the x butto…
bergmeister Jan 22, 2019
f8a693e
[Ignore] Prep 1.11 release with Changelog (#1715)
TylerLeonhardt Jan 23, 2019
ef8c85a
turn off non-windows gate for attach to process (#1736)
TylerLeonhardt Jan 30, 2019
cc24c5a
Add an Exclusion filter to the Command Explorer. (#1686)
corbob Jan 28, 2019
07c52b9
Setting CommandExp ExcludeFilter to be empty array (#1738)
adilio Jan 29, 2019
f386524
Handle Pester Describe block strings with single quotes inside it (#1…
bergmeister Feb 11, 2019
e406d2c
Update build to clear node modules directory (#1741)
corbob Feb 8, 2019
fb2a0af
Fix Right Click Help lookup not always working. (#1743)
corbob Feb 8, 2019
9383a28
Add label property to debug config, change pkg name to lowercase (#1746)
rkeithhill Feb 8, 2019
649d633
Modify powerShellDefaultVersion desc to make clearer (#1747)
rkeithhill Feb 8, 2019
3e782df
Speed up travis builds by skipping the .net core initialisation (#1755)
bergmeister Feb 11, 2019
e23c960
[ignore] package lock merge conflict
rkeithhill Feb 26, 2019
3f48139
[ignore] package lock merge conflict
TylerLeonhardt Mar 5, 2019
9cf035c
Added Pester, ShouldProcess and Calculated Property PS Snippets (#1764)
brettmillerb Mar 5, 2019
e1a8ca8
Migrate Pester version detection into an InovkePester stub script (#1…
rkeithhill Mar 5, 2019
eaa730e
fix initial launch config casing (#1781)
TylerLeonhardt Mar 8, 2019
0cb43c3
Support -CustomPipeName (#1775)
TylerLeonhardt Mar 10, 2019
87e05d7
Add Debug Runspace command (#1782)
adamdriscoll Mar 13, 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
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ language: cpp
git:
depth: 1000

env:
# Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1

os:
- linux
- osx
Expand Down
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# vscode-powershell Release History

## v1.11.0
### Wednesday, January 23, 2019
#### [vscode-powershell](https://github.com/powershell/vscode-powershell)

- [vscode-PowerShell #1714](https://github.com/PowerShell/vscode-PowerShell/pull/1714) -
Do not run pester tests when user cancels questions using the x button (Thanks @bergmeister!)
- [vscode-PowerShell #1701](https://github.com/PowerShell/vscode-PowerShell/pull/1701) -
Interpret null Describe TestName to mean value can't be eval'd (Thanks @rkeithhill!)
- [vscode-PowerShell #1698](https://github.com/PowerShell/vscode-PowerShell/pull/1698) -
Add 'Run/Debug Pester tests' command and file tab menu (Thanks @bergmeister!)
- [vscode-PowerShell #1697](https://github.com/PowerShell/vscode-PowerShell/pull/1697) -
Remove Region Block snippet (Thanks @fullenw1!)
- [vscode-PowerShell #1690](https://github.com/PowerShell/vscode-PowerShell/pull/1690) -
Refresh CommandExplorer on visible
- [vscode-PowerShell #1688](https://github.com/PowerShell/vscode-PowerShell/pull/1688) -
Fix spacing of package.json after running Invoke-Build to not end up with local changes (Thanks @bergmeister!)
- [vscode-PowerShell #1638](https://github.com/PowerShell/vscode-PowerShell/pull/1638) -
Add icons and enable setting for Command Explorer (Thanks @corbob!)
- [vscode-PowerShell #1679](https://github.com/PowerShell/vscode-PowerShell/pull/1679) -
Update broken links in README (Thanks @josh-!)
- [vscode-PowerShell #1670](https://github.com/PowerShell/vscode-PowerShell/pull/1670) -
Update recommended NodeJS version to 8.x since 6.x will go out of support in April 2019 (Thanks @bergmeister!)

#### [PowerShellEditorServices](https://github.com/powershell/PowerShellEditorServices)

- [PowerShellEditorServices #851](https://github.com/PowerShell/PowerShellEditorServices/pull/851) -
Fix #827 Pester TestName w/expandable str returns nothing (Thanks @rkeithhill!)
- [PowerShellEditorServices #842](https://github.com/PowerShell/PowerShellEditorServices/pull/842) -
Fix typos (Thanks @alexandair!)
- [PowerShellEditorServices #838](https://github.com/PowerShell/PowerShellEditorServices/pull/838) -
Fix NullRefEx bug when accessing scriptFile.ReferencedFiles (Thanks @rkeithhill!)
- [PowerShellEditorServices #839](https://github.com/PowerShell/PowerShellEditorServices/pull/839) -
Fix FileNotFoundEx crash when Fold happens on untitled: scheme doc (Thanks @rkeithhill!)
- [PowerShellEditorServices #843](https://github.com/PowerShell/PowerShellEditorServices/pull/843) -
Simplify the parameter descriptions and fix typos (Thanks @alexandair!)
- [PowerShellEditorServices #844](https://github.com/PowerShell/PowerShellEditorServices/pull/844) -
Fix an empty verbose message when importing an editor command (Thanks @alexandair!)
- [PowerShellEditorServices #828](https://github.com/PowerShell/PowerShellEditorServices/pull/828) -
Compile against net452 because net451 is not supported any more (Thanks @bergmeister!)
- [PowerShellEditorServices #848](https://github.com/PowerShell/PowerShellEditorServices/pull/848) -
switch an instance of GetFile to TryGetFile to fix #1689
- [PowerShellEditorServices #846](https://github.com/PowerShell/PowerShellEditorServices/pull/846) -
Workaround "attach to process" hang
- [PowerShellEditorServices #829](https://github.com/PowerShell/PowerShellEditorServices/pull/829) -
Update various NuGet packages (Thanks @bergmeister!)
- [PowerShellEditorServices #825](https://github.com/PowerShell/PowerShellEditorServices/pull/825) -
(GH-824)(GH-812) Improve code folding speed (Thanks @glennsarti!)
- [PowerShellEditorServices #850](https://github.com/PowerShell/PowerShellEditorServices/pull/850) -
Fix VSCODE 1683 - HelpCommentReqHdlr crash on GetFile (Thanks @rkeithhill!)
- [PowerShellEditorServices #837](https://github.com/PowerShell/PowerShellEditorServices/pull/837) -
(maint) Add traits for folding tests (Thanks @glennsarti!)

## v1.10.2
### Tuesday, December 18, 2018

Expand Down
82 changes: 82 additions & 0 deletions InvokePesterStub.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env pwsh

<#
.SYNOPSIS
Stub around Invoke-Pester command used by VSCode PowerShell extension.
.DESCRIPTION
The stub checks the version of Pester and if >= 4.6.0, invokes Pester
using the LineNumber parameter (if specified). Otherwise, it invokes
using the TestName parameter (if specified). If the All parameter
is specified, then all the tests are invoked in the specifed file.
Finally, if none of these three parameters are specified, all tests
are invoked and a warning is issued indicating what the user can do
to allow invocation of individual Describe blocks.
.EXAMPLE
PS C:\> .\InvokePesterStub.ps1 ~\project\test\foo.tests.ps1 -LineNumber 14
Invokes a specific test by line number in the specified file.
.EXAMPLE
PS C:\> .\InvokePesterStub.ps1 ~\project\test\foo.tests.ps1 -TestName 'Foo Tests'
Invokes a specific test by test name in the specified file.
.EXAMPLE
PS C:\> .\InvokePesterStub.ps1 ~\project\test\foo.tests.ps1 -All
Invokes all tests in the specified file.
.INPUTS
None
.OUTPUTS
None
#>
param(
# Specifies the path to the test script.
[Parameter(Position=0, Mandatory)]
[ValidateNotNullOrEmpty()]
[string]
$ScriptPath,

# Specifies the name of the test taken from the Describe block's name.
[Parameter()]
[string]
$TestName,

# Specifies the starting line number of the DescribeBlock. This feature requires
# Pester 4.6.0 or higher.
[Parameter()]
[ValidatePattern('\d*')]
[string]
$LineNumber,

# If specified, executes all the tests in the specified test script.
[Parameter()]
[switch]
$All
)

$pesterModule = Microsoft.PowerShell.Core\Get-Module Pester
if (!$pesterModule) {
Write-Output "Importing Pester module..."
$pesterModule = Microsoft.PowerShell.Core\Import-Module Pester -ErrorAction Ignore -PassThru
if (!$pesterModule) {
# If we still don't have an imported Pester module, that is (most likely) because Pester is not installed.
Write-Warning "Failed to import the Pester module. You must install Pester to run or debug Pester tests."
Write-Warning "You can install Pester by executing: Install-Module Pester -Scope CurrentUser -Force"
return
}
}

if ($All) {
Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true}
}
elseif ($TestName) {
Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true} -TestName $TestName
}
elseif (($LineNumber -match '\d+') -and ($pesterModule.Version -ge '4.6.0')) {
Pester\Invoke-Pester -Script $ScriptPath -PesterOption (New-PesterOption -ScriptBlockFilter @{
IncludeVSCodeMarker=$true; Line=$LineNumber; Path=$ScriptPath})
}
else {
# We get here when the TestName expression is of type ExpandableStringExpressionAst.
# PSES will not attempt to "evaluate" the expression so it returns null for the TestName.
Write-Warning "The Describe block's TestName cannot be evaluated. EXECUTING ALL TESTS instead."
Write-Warning "To avoid this, install Pester >= 4.6.0 or remove any expressions in the TestName."

Pester\Invoke-Pester -Script $ScriptPath -PesterOption @{IncludeVSCodeMarker=$true}
}
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '1.10.3-insiders-{build}'
version: '1.11.0-insiders-{build}'
image: Visual Studio 2017
clone_depth: 10
skip_tags: true
Expand Down
70 changes: 48 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "PowerShell",
"name": "powershell",
"displayName": "PowerShell",
"version": "1.10.3",
"version": "1.11.0",
"publisher": "ms-vscode",
"description": "Develop PowerShell scripts in Visual Studio Code!",
"engines": {
Expand Down Expand Up @@ -31,6 +31,7 @@
"onCommand:PowerShell.NewProjectFromTemplate",
"onCommand:PowerShell.OpenExamplesFolder",
"onCommand:PowerShell.PickPSHostProcess",
"onCommand:PowerShell.PickRunspace",
"onCommand:PowerShell.SpecifyScriptArgs",
"onCommand:PowerShell.ShowSessionConsole",
"onCommand:PowerShell.ShowSessionMenu",
Expand Down Expand Up @@ -303,6 +304,7 @@
"debuggers": [
{
"type": "PowerShell",
"label": "PowerShell",
"enableBreakpointsFor": {
"languageIds": [
"powershell"
Expand All @@ -312,6 +314,7 @@
"runtime": "node",
"variables": {
"PickPSHostProcess": "PowerShell.PickPSHostProcess",
"PickRunspace": "PowerShell.PickRunspace",
"SpecifyScriptArgs": "PowerShell.SpecifyScriptArgs"
},
"languages": [
Expand All @@ -322,9 +325,9 @@
"label": "PowerShell: Launch Current File",
"description": "Launch current file (in active editor window) under debugger",
"body": {
"name": "PowerShell Launch Current File",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File",
"script": "^\"\\${file}\"",
"args": [],
"cwd": "^\"\\${file}\""
Expand All @@ -334,9 +337,9 @@
"label": "PowerShell: Launch Current File in Temporary Console",
"description": "Launch current file (in active editor window) under debugger in a temporary Integrated Console.",
"body": {
"name": "PowerShell Launch Current File in Temporary Console",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File in Temporary Console",
"script": "^\"\\${file}\"",
"args": [],
"cwd": "^\"\\${file}\"",
Expand All @@ -347,9 +350,9 @@
"label": "PowerShell: Launch Current File w/Args Prompt",
"description": "Launch current file (in active editor window) under debugger, prompting first for script arguments",
"body": {
"name": "PowerShell Launch Current File w/Args Prompt",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File w/Args Prompt",
"script": "^\"\\${file}\"",
"args": [
"^\"\\${command:SpecifyScriptArgs}\""
Expand All @@ -361,9 +364,9 @@
"label": "PowerShell: Launch Script",
"description": "Launch specified script or path to script under debugger",
"body": {
"name": "PowerShell Launch ${Script}",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch ${Script}",
"script": "^\"\\${workspaceFolder}/${Script}\"",
"args": [],
"cwd": "^\"\\${workspaceFolder}\""
Expand All @@ -373,9 +376,9 @@
"label": "PowerShell: Pester Tests",
"description": "Invokes Pester tests under debugger",
"body": {
"name": "PowerShell Pester Tests",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Pester Tests",
"script": "Invoke-Pester",
"args": [],
"cwd": "^\"\\${workspaceFolder}\""
Expand All @@ -385,22 +388,31 @@
"label": "PowerShell: Attach to PowerShell Host Process",
"description": "Open host process picker to select process to attach debugger to",
"body": {
"name": "PowerShell Attach to Host Process",
"type": "PowerShell",
"request": "attach",
"name": "PowerShell Attach to Host Process",
"processId": "^\"\\${command:PickPSHostProcess}\"",
"runspaceId": 1
}
},
{
"label": "PowerShell: Interactive Session",
"description": "Start interactive session (Debug Console) under debugger",
"body": {
"name": "PowerShell Interactive Session",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"cwd": ""
}
},
{
"label": "PowerShell: Attach Interactive Session Runspace",
"description": "Open runspace picker to select runspace to attach debugger to",
"body": {
"name": "PowerShell Attach Interactive Session Runspace",
"type": "PowerShell",
"request": "attach",
"processId": "current"
}
}
],
"configurationAttributes": {
Expand Down Expand Up @@ -439,56 +451,65 @@
"processId": {
"type": "string",
"description": "The process id of the PowerShell host process to attach to. Works only on PowerShell 5 and above.",
"default": "${command:PickPSHostProcess}"
"default": null
},
"runspaceId": {
"type": "number",
"type":["string","number"],
"description": "Optional: The ID of the runspace to debug in the attached process. Defaults to 1. Works only on PowerShell 5 and above.",
"default": 1
"default": null
},
"customPipeName": {
"type": "string",
"description": "The custom pipe name of the PowerShell host process to attach to. Works only on PowerShell 6.2 and above.",
"default": null
}
}
}
},
"initialConfigurations": [
{
"name": "PowerShell Launch Current File",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File",
"script": "${file}",
"args": [],
"cwd": "${file}"
},
{
"name": "PowerShell Launch Current File in Temporary Console",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File in Temporary Console",
"script": "${file}",
"args": [],
"cwd": "${file}",
"createTemporaryIntegratedConsole": true
},
{
"name": "PowerShell Launch Current File w/Args Prompt",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch Current File w/Args Prompt",
"script": "${file}",
"args": [
"${command:SpecifyScriptArgs}"
],
"cwd": "${file}"
},
{
"type": "PowerShell",
"request": "attach",
"name": "PowerShell Attach to Host Process",
"processId": "${command:PickPSHostProcess}",
"runspaceId": 1
"type": "PowerShell",
"request": "attach"
},
{
"name": "PowerShell Interactive Session",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"cwd": ""
},
{
"name": "PowerShell Attach Interactive Session Runspace",
"type": "PowerShell",
"request": "attach",
"processId": "current"
}
]
}
Expand All @@ -502,6 +523,11 @@
"default": true,
"description": "Specifies the visibility of the Command Explorer in the PowerShell Side Bar."
},
"powershell.sideBar.CommandExplorerExcludeFilter": {
"type": "array",
"default": [],
"description": "Specify array of Modules to exclude from Command Explorer listing."
},
"powershell.powerShellExePath": {
"type": "string",
"default": "",
Expand Down Expand Up @@ -533,7 +559,7 @@
},
"powershell.powerShellDefaultVersion": {
"type": "string",
"description": "Specifies the name of the PowerShell version used in the startup session when the extension loads e.g \"Windows PowerShell (x86)\" or \"PowerShell Core 6.0.2 (x64)\"."
"description": "Specifies the PowerShell version name, as displayed by the 'PowerShell: Show Session Menu' command, used when the extension loads e.g \"Windows PowerShell (x86)\" or \"PowerShell Core 6 (x64)\"."
},
"powershell.startAutomatically": {
"type": "boolean",
Expand Down
Loading