-
Notifications
You must be signed in to change notification settings - Fork 82
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
Merged xTimeZone and converted to HQRM - Fixes #157 #158
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #158 +/- ##
===================================
+ Coverage 89% 89% +<1%
===================================
Files 5 6 +1
Lines 647 668 +21
===================================
+ Hits 579 600 +21
Misses 68 68 |
Reviewed 18 of 18 files at r1. README.md, line 20 at r1 (raw file):
Maybe remove this so we don't reference 'x' resources. It says that in the changelog, should be enough with that plus a deprecated message in xTimeZone? Modules/ComputerManagementDsc/DSCResources/MSFT_TimeZone/MSFT_TimeZone.psm1, line 20 at r1 (raw file):
Should be indented one more step. Throughout. Modules/ComputerManagementDsc/DSCResources/MSFT_TimeZone/MSFT_TimeZone.psm1, line 95 at r1 (raw file):
Non-blocking: Does auto-formatting do this indentation? If so, good as-is. It just looks wrong indented with two tabs, but just my personal opinion, so again, non-blocking. 😃 Modules/ComputerManagementDsc/DSCResources/MSFT_TimeZone/en-us/MSFT_TimeZone.strings.psd1, line 4 at r1 (raw file):
Don't think this used? 🤔 Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 345 at r1 (raw file):
Shouldn't we keep this as a helper function in the resource .psm1 file instead if that resource is the only one using this? Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 382 at r1 (raw file):
See previous comment. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 405 at r1 (raw file):
See previous comment Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 455 at r1 (raw file):
See previous comment Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 1 at r1 (raw file):
Maybe we could add a comment what this file and namespace does? Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 212 at r1 (raw file):
Maybe we could add a debug parameter that is default Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/en-us/ComputerManagementDsc.Common.strings.psd1, line 15 at r1 (raw file):
If we move the functions (see previous comments) these should move too. Comments from Reviewable |
Review status: 14 of 18 files reviewed at latest revision, 10 unresolved discussions. README.md, line 20 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Modules/ComputerManagementDsc/DSCResources/MSFT_TimeZone/MSFT_TimeZone.psm1, line 20 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Modules/ComputerManagementDsc/DSCResources/MSFT_TimeZone/MSFT_TimeZone.psm1, line 95 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
It doesn't correct it - but I've put it on the same line now anyway. So fixed hopefully 😁 Modules/ComputerManagementDsc/DSCResources/MSFT_TimeZone/en-us/MSFT_TimeZone.strings.psd1, line 4 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Wow - great catch! Fixed. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 345 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
It is actually used by some of the integration tests for ScheduledTasks. I could move these and keep two copies, but it felt like duplication. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 382 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
It is actually used by some of the integration tests for ScheduledTasks. I could move these and keep two copies, but it felt like duplication. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 405 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
It is actually used by some of the integration tests for ScheduledTasks. I could move these and keep two copies, but it felt like duplication. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 455 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
It is actually used by some of the integration tests for ScheduledTasks. I could move these and keep two copies, but it felt like duplication. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 1 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 212 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/en-us/ComputerManagementDsc.Common.strings.psd1, line 15 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
See previous - happy to move these. Comments from Reviewable |
Reviewed 4 of 4 files at r2. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 345 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
No, we shouldn't duplicate code. Could we add a .NOTES section explaining that these are also used by the integration tests? Same for the three other functions. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 1 at r2 (raw file):
Could we make this code run in the integration test also by mocking "away" the cmdlets? It is tested in the unit tests but would be great if we could run this in the integration tests too? Comments from Reviewable |
@PlagueHO my last comment, I meant to say that the cmdlets is mocked "away" in the unit test, but the C# code is never added I think, since that helper function is mock too. So if we could actually run the C# code in the integration test that would be great I think. |
Review status: 17 of 18 files reviewed at latest revision, 3 unresolved discussions. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/ComputerManagementDsc.Common.psm1, line 345 at r1 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 1 at r2 (raw file): Previously, johlju (Johan Ljunggren) wrote…
I'm not sure this is possible (to Mock within the integration tests) because the LCM runs under the context of a WMI process - not the process that invokes it. So the ComputerManagementDsc.Common module (that contains Test-Command) isn't loaded to even mock (it is loaded into the WMI process context). But to make double sure I did actually give it a try 😢 Would have been great if it could have worked. Comments from Reviewable |
Review status: 17 of 18 files reviewed at latest revision, 3 unresolved discussions. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 1 at r2 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Yes that won't work. My thought was not run it in LCM but run the helper commands directly in a (separate) integration tests after the LCM tests has run. Would that work? Comments from Reviewable |
Review status: 17 of 18 files reviewed at latest revision, 1 unresolved discussion. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 1 at r2 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Oh I see what you mean - yes, I think that would work. I'll see what I can do. Comments from Reviewable |
Review status: 15 of 19 files reviewed at latest revision, 1 unresolved discussion. Modules/ComputerManagementDsc/Modules/ComputerManagementDsc.Common/SetTimeZone.cs, line 1 at r2 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Done. Comments from Reviewable |
Should be ready for review now- thanks @johlju Review status: 15 of 19 files reviewed at latest revision, 1 unresolved discussion. Comments from Reviewable |
Reviewed 1 of 1 files at r3, 3 of 3 files at r4. Tests/Integration/ComputerManagementDsc.Common.Tests.ps1, line 61 at r4 (raw file):
We are mocking Add-Type here so it will never run the .cs code? And the next row we are mocking Set-TimeZoneUsingDotNet that actually loads the C# code? :) Comments from Reviewable |
Review status: 17 of 19 files reviewed at latest revision, 1 unresolved discussion. Tests/Integration/ComputerManagementDsc.Common.Tests.ps1, line 61 at r4 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Wow - that was a great catch and identified a problem with the C# debug code - which I've now removed entirely. It just resulted in warnings and other stuff anyway due to "Unreachable code". Comments from Reviewable |
Awesome work here, as usually! 😄 Reviewed 2 of 2 files at r5. Comments from Reviewable |
Thank you so much @johlju! I'll get to work on xPendingReboot next weekend (the rest of the week I'm presenting 😢) Review status: all files reviewed at latest revision, all discussions resolved, all commit checks successful. Comments from Reviewable |
Pull Request (PR) description
This PR moves the xTimeZone resource into this repo and renames it to TimeZone.
This Pull Request (PR) fixes the following issues:
Task list:
@johlju - would you mind reviewing this if you get a moment? It is mostly the original xTimeZone, but updated to HQRM.
This change is