-
Notifications
You must be signed in to change notification settings - Fork 134
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
Clean xScript resource and add tests #290
Conversation
[CmdletBinding()] | ||
param () | ||
|
||
if ($null -eq $script:appVeyorAdministratorCredential) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set-StrictMode -Version latest
is not on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TravisEz13 It's turned on in #289 where I made the main changes to the CommonTestHelper. You can see it is included on this line for the changes included in that PR. This exact same function is there and passes StrictMode.
I did not want to include all the changes to the CommonTestHelper here. I only included Get-AppVeyorAdministratorCredential
here because it is needed to get a valid credential to test running a script under.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI, this will break when they merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the variable initialization
5d12962
to
03aeb98
Compare
Reviewed 8 of 11 files at r1, 3 of 3 files at r2. README.md, line 230 at r2 (raw file):
'A string that can be used to create a PowerShell script block...' DSCResources/MSFT_xScriptResource/MSFT_xScriptResource.psm1, line 210 at r2 (raw file):
'...result of the script execution.' DSCResources/MSFT_xScriptResource/MSFT_xScriptResource.schema.mof, line 6 at r2 (raw file):
'..to create a PowerShell script block..' DSCResources/MSFT_xScriptResource/en-US/MSFT_xScriptResource.schema.mfl, line 5 at r2 (raw file):
'...to create a PowerShell script block...' Tests/CommonTestHelper.psm1, line 784 at r2 (raw file):
New-Object -TypeName System.Random Tests/CommonTestHelper.psm1, line 785 at r2 (raw file):
single quotes Tests/CommonTestHelper.psm1, line 786 at r2 (raw file):
[Char] Tests/CommonTestHelper.psm1, line 793 at r2 (raw file):
single quotes Tests/Integration/MSFT_xScriptResource.Integration.Tests.ps1, line 44 at r2 (raw file):
'Get, Set, and Test...' Tests/Integration/MSFT_xScriptResource.Integration.Tests.ps1, line 70 at r2 (raw file):
'Should have created the test file' Tests/Integration/MSFT_xScriptResource.Integration.Tests.ps1, line 79 at r2 (raw file):
'Get, Set, Test..' Tests/Integration/MSFT_xScriptResource.Integration.Tests.ps1, line 116 at r2 (raw file):
'...the test file' Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 1 at r2 (raw file):
It doesn't look like these are being skipped anymore Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 22 at r2 (raw file):
no space needed between '@(' and '$testUsername'. Or, add a space before the last parenthesis Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 90 at r2 (raw file):
I know it's kind of a pain, but can you break up the 'Assert-MockCalled lines' Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 283 at r2 (raw file):
'Specified test script' Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 309 at r2 (raw file):
'Specified test script...' Comments from Reviewable |
03aeb98
to
13953f4
Compare
Review status: 4 of 11 files reviewed at latest revision, 18 unresolved discussions. README.md, line 230 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. DSCResources/MSFT_xScriptResource/MSFT_xScriptResource.psm1, line 210 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. DSCResources/MSFT_xScriptResource/MSFT_xScriptResource.schema.mof, line 6 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. DSCResources/MSFT_xScriptResource/en-US/MSFT_xScriptResource.schema.mfl, line 5 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/CommonTestHelper.psm1, line 784 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/CommonTestHelper.psm1, line 785 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/CommonTestHelper.psm1, line 786 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/CommonTestHelper.psm1, line 793 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/Integration/MSFT_xScriptResource.Integration.Tests.ps1, line 44 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
I prefer them as lower-case adjectives here. Tests/Integration/MSFT_xScriptResource.Integration.Tests.ps1, line 70 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/Integration/MSFT_xScriptResource.Integration.Tests.ps1, line 79 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
I prefer them as lower-case adjectives here. Tests/Integration/MSFT_xScriptResource.Integration.Tests.ps1, line 116 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 1 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 22 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 90 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 283 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Tests/Unit/MSFT_xScriptResource.Tests.ps1, line 309 at r2 (raw file): Previously, mbreakey3 (Mariah) wrote…
Done. Comments from Reviewable |
Reviewed 7 of 7 files at r3. Comments from Reviewable |
13953f4
to
f97be65
Compare
Review status: 10 of 11 files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
This is the cleaned xScript resource for #160.
Unit and integration tests have been added and the documentation for xScript has been updated accordingly.
I also just moved the xWindowsFeature section in the README to where it should be alphabetically in the list since it was originally where Script should go.
This PR contains a change that is also included in #289 which is the Get-AppVeyorAdministrator credential in the CommonTestHelper. I will rebase and resolve the conflict after one of these two PRs is merged.
@mbreakey3 and/or @TravisEz13 Please review.
This change is