-
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
xSQLServerRSConfig: Replaced sqlcmd.exe with Invoke-Sqlcmd #571
Conversation
Replaced two sqlcmd.exe executions with Invoke-Sqlcmd calls. A small code cleanup as the result of the above change. Removed the conditional use of $RSConfig.MachineAccountIdentity as $RSSvcAccountUsername, since it was always empty (tested on SQL2014 only). Need to double-check this.
Hi @johlju, here's the first PR for xSQLServerRSConfig :) As I've mentioned in the commit message, I've removed a bit of code that conditionally changed Please let me know if that code is needed (if it is, we'll still have to handle the scenario where I'll update CHANGELOG.md shortly. |
Codecov Report
@@ Coverage Diff @@
## dev #571 +/- ##
====================================
+ Coverage 80% 81% +<1%
====================================
Files 32 32
Lines 3488 3462 -26
====================================
Hits 2808 2808
+ Misses 680 654 -26 |
First! Big thanks for creating the issues and sending in this PR! Awesome work! 😃 I rearranged the PR description a bit. Mostly to add 'Fixes...' so that the issue will auto-close on merge. :) Could you add an issue for '$RSConfig.MachineAccountIdentity is always empty on SQL2014' and suggest that is replaced in the way you replaced it? Also add to the PR description that this PR fixes that issue. This resource lacks Pester unit tests, I would really like unit test for at least the code that is changed. Would you be up to write those? Otherwise I would be more than happy to help with that. 😄 |
Regarding Reading MS docs here: https://docs.microsoft.com/hr-hr/sql/reporting-services/wmi-provider-library-reference/configurationsetting-property-machineaccountidentity It looks like the property holds the machine's domain account and my test machine is not in a domain - which would explain It's simple enough to make |
Regarding Pester tests, I've never used Pester, so it might be faster if you wrote at least some initial tests. I promise I'll start learning it :) |
I have to agree, it is very odd chaning user to So I would say it should not be necessary. If it is, then hopefully we get an issue for it and it can be documented appropriately. |
I will look into fixing Pester tests for this PR. 😄 Is it okay if you enable "Allow edits from maintainers"? You find it to the right, somewhere under 'Notifications'. This way I can push code directly into your PR. |
Ok, I'll keep the change that removes I've checked "Allow edits from maintainers" on all three PRs. |
I will start with the tests for this as soon as I sent in the PR I'm working on now. So later tonight or tomorrow. |
@bozho My suggestion that you could make several PR's, and each having the previous PR's commits, back fired a bit now. It's making it hard to do a test, I don't want to do test code for something that should not be there in the end. 😄 And I don't like the idea to merge something that is not tested. It seems #575 has all code from #571 and #573, am i correct? If so, then I think we need to do the following. Let me know if you think differently.
After that we continue work on #575 so it gets merged. Sorry again 😞 |
Well, the PRs are all compared against Would you like to try it that way? I understand your concerns about testing, but I'm not even sure how would you unit-test #571 or #573. Testing sqlcmd replacing seems more like an integration test material :) xSQLServerRSConfig doesn't have any tests now anyway. We can probably come up with unit tests for #575 and #570 (and its future PR) |
This is partially finished. Work continues in #573 and #575. Tests will be added to the code in PR #575 Reviewed 1 of 1 files at r1, 1 of 1 files at r2. Comments from Reviewable |
I did manually integration test (yes we need real integration tests 😉 ) and this code works flawless of what I can see. Awesome work @bozho!! 😄 |
Pull Request (PR) description
Replaced two sqlcmd.exe executions with Invoke-Sqlcmd calls.
A small code cleanup as the result of the above change.
Removed the conditional use of $RSConfig.MachineAccountIdentity as
$RSSvcAccountUsername, since it was always empty (tested on SQL2014
only). Need to double-check this.
This Pull Request (PR) fixes the following issues:
Fixes #567
Task list:
This change is