Skip to content

Conversation

@BrucePay
Copy link
Collaborator

@BrucePay BrucePay commented Apr 9, 2018

Fix #4520

Just removed the [ValidateIsNotNulOrEmpty] attribute from the ArgumentList parameter. (Also removed some obsolete comments).

PR Summary

PR Checklist

Copy link
Collaborator

@iSazonov iSazonov Apr 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be -ArgumentList "" ?
And should we tests -ArgumentList @() too?

@markekraus
Copy link
Contributor

@BrucePay can you please push an empty commit with [feature]? The tests in this PR are gated by the feature flag.

@SteveL-MSFT
Copy link
Member

@BrucePay I believe GitHub won't auto-close issues in the title, so I put Fix #4520 in the PR description which works.

For @markekraus' request, you can just do git commit --amend and update the description where the first line is [feature] which will kick off the feature tests in CI

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use -TestCases and replace last three tests with one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather do this in a separate check-in. This whole file needs serious clean up e.g. there are tests that depend on notepad.

@SteveL-MSFT
Copy link
Member

@BrucePay looks like you accidentally pulled in other commits into this PR. Find me tomorrow in the office to get this cleaned up.

@BrucePay
Copy link
Collaborator Author

@SteveL-MSFT Not sure how it happened bu oh my yes :-( I will definitely find you.

@BrucePay BrucePay force-pushed the brucepay_StartProcessArgs branch 3 times, most recently from d2da162 to 761748a Compare April 26, 2018 18:51
@BrucePay BrucePay force-pushed the brucepay_StartProcessArgs branch from 761748a to 22e1d11 Compare April 26, 2018 19:14
@BrucePay BrucePay force-pushed the brucepay_StartProcessArgs branch from 22e1d11 to 01603a5 Compare April 26, 2018 22:39
Copy link
Member

@adityapatwardhan adityapatwardhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please submit the last commit with [Feature] in the commit message to execute the tests in the PR.

git commit --allow-empty
git push

It 'Should run without errors when -ArgumentList is $null' {
$process = Start-Process $pingCommand -ArgumentList $null -PassThru @extraArgs
$process.Length | Should -Be 1
$process.Id | Should -BeGreaterThan 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are basic sanity tests to make sure the process was created and is running (has an ID).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the process is not started the $process is $null.

It "Should run without errors when -ArgumentList is @()" {
$process = Start-Process $pingCommand -ArgumentList @() -PassThru @extraArgs
$process.Length | Should -Be 1
$process.Id | Should -BeGreaterThan 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are basic sanity tests to make sure the process was created and is running (has an ID).

It "Should run without errors when -ArgumentList is ''" {
$process = Start-Process $pingCommand -ArgumentList '' -PassThru @extraArgs
$process.Length | Should -Be 1
$process.Id | Should -BeGreaterThan 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are basic sanity tests to make sure the process was created and is running (has an ID).

@adityapatwardhan
Copy link
Member

pushed a commit with [Feature] to kick off all tests.

@adityapatwardhan adityapatwardhan merged commit bbb4f2e into PowerShell:master Jun 22, 2018
@TravisEz13
Copy link
Member

@adityapatwardhan Please make sure you check the PR title before merging. The Fix for #4520 should not be in the PR title.

@adityapatwardhan
Copy link
Member

@TravisEz13 Yes agreed, missed it.

msoxzw pushed a commit to msoxzw/quiet-windows-10 that referenced this pull request Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Start-Process -ArgumentList should accept an empty array / the null collection and interpret that as "no arguments to pass"

8 participants