-
Notifications
You must be signed in to change notification settings - Fork 225
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
SqlServerEndpoint : Add parameter "Owner" #1271
SqlServerEndpoint : Add parameter "Owner" #1271
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #1271 +/- ##
=====================================
+ Coverage 97% 97% +<1%
=====================================
Files 34 34
Lines 4197 4208 +11
=====================================
+ Hits 4106 4117 +11
Misses 91 91 |
…rameter name in the Schema file
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.
Great work on this! 🙂 Just a couple of comments, one a logical error I think in the Test-TargetResource
function.
Reviewed 1 of 6 files at r1, 5 of 5 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mdaniou)
DSCResources/MSFT_SqlServerEndpoint/MSFT_SqlServerEndpoint.psm1, line 302 at r2 (raw file):
elseif ($getTargetResourceResult.Ensure -eq 'Present' -and $Owner)
Instead of this, shouldn't we check this like Port and IpAddress are checked in the if-block above? 🤔
if ($getTargetResourceResult.Ensure -eq 'Present' `
-and (
$getTargetResourceResult.Port -ne $Port `
-or $getTargetResourceResult.IpAddress -ne $IpAddress
-or $getTargetResourceResult.Owner-ne $Owner
)
)
Tests/Unit/MSFT_SqlServerEndpoint.Tests.ps1, line 333 at r2 (raw file):
listener IP address
should me 'owner' here in the comment?
@mdaniou There hasn't been a integration test written for this resource yet, so I will no enforce it. There is another issue open to get an integration tests for this resource. 🙂 |
@johlju I am actually working on the integration test for this resource. |
Oh that is awesome! 😄 Is your plan to add it to this PR or send in a new PR with the integration test? Either way works for me. |
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.
Reviewable status: 4 of 6 files reviewed, 2 unresolved discussions (waiting on @johlju)
DSCResources/MSFT_SqlServerEndpoint/MSFT_SqlServerEndpoint.psm1, line 302 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
elseif ($getTargetResourceResult.Ensure -eq 'Present' -and $Owner)
Instead of this, shouldn't we check this like Port and IpAddress are checked in the if-block above? 🤔
if ($getTargetResourceResult.Ensure -eq 'Present' ` -and ( $getTargetResourceResult.Port -ne $Port ` -or $getTargetResourceResult.IpAddress -ne $IpAddress -or $getTargetResourceResult.Owner-ne $Owner ) )
Well I did that at first then I realized that if $Owner parameter is null then it will fail as the owner is set at creation and is the login used to actually create it :) . Hence the comparison won't work. I need to test only if the parameter is filled.
However I now figure that my code is incomplete. It should be :
elseif ($getTargetResourceResult.Ensure -eq 'Present' -and $Owner `
-and $getTargetResourceResult.Owner -ne $Owner
)
Tests/Unit/MSFT_SqlServerEndpoint.Tests.ps1, line 333 at r2 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
listener IP address
should me 'owner' here in the comment?
Indeed
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.
Reviewable status: 4 of 6 files reviewed, 2 unresolved discussions (waiting on @johlju)
DSCResources/MSFT_SqlServerEndpoint/MSFT_SqlServerEndpoint.psm1, line 302 at r2 (raw file):
Previously, mdaniou (Maxime Daniou) wrote…
Well I did that at first then I realized that if $Owner parameter is null then it will fail as the owner is set at creation and is the login used to actually create it :) . Hence the comparison won't work. I need to test only if the parameter is filled.
However I now figure that my code is incomplete. It should be :elseif ($getTargetResourceResult.Ensure -eq 'Present' -and $Owner ` -and $getTargetResourceResult.Owner -ne $Owner )
Done.
Tests/Unit/MSFT_SqlServerEndpoint.Tests.ps1, line 333 at r2 (raw file):
Previously, mdaniou (Maxime Daniou) wrote…
Indeed
Done.
I will keep them separate as I started working on it after I created this PR. No need to mix up everything :) |
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.
Reviewed 2 of 2 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved
Pull Request (PR) description
Adding the parameter "Owner" to allow to specify it at creation
It seems like there is no integration test for this resource.
This Pull Request (PR) fixes the following issues
Task list
Entry should say what was changed, and how that affects users (if applicable).
and comment-based help.
This change is