-
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
SqlTraceflag: Correctly loads the SMO assemblies #1682
Conversation
Style guideline fixes and move change log entries
…all test for this.
@johlju This imports the module, but supresses the verbose message about loading the module. In the same function we could also remove the |
Codecov Report
@@ Coverage Diff @@
## main #1682 +/- ##
====================================
Coverage 97% 97%
====================================
Files 38 38
Lines 6259 6261 +2
====================================
+ Hits 6102 6104 +2
Misses 157 157
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thank you for fixing this issue. Just tiny comments then this is ready to merge.
Reviewed 2 of 10 files at r4.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @Fiander)
a discussion (no related file):
Please add a mock for Import-SQLPSModule
in the unit test for the respective function.
CHANGELOG.md, line 9 at r4 (raw file):
.·
Remove full stop (.
) here, there is already (correctly) a full stop after the issue link.
source/DSCResources/DSC_SqlTraceFlag/DSC_SqlTraceFlag.psm1, line 36 at r4 (raw file):
#Import SqlServer module but suppress verbose message.
We should have a space after the #
, # Import...
.
source/DSCResources/DSC_SqlTraceFlag/DSC_SqlTraceFlag.psm1, line 37 at r4 (raw file):
4>$null
Let us remove this so this won't be a problem when we fix issue #1564.
source/DSCResources/DSC_SqlTraceFlag/DSC_SqlTraceFlag.psm1, line 151 at r4 (raw file):
#Import SqlServer module but suppress verbose message.
We should have a space after the #
, # Import...
.
source/DSCResources/DSC_SqlTraceFlag/DSC_SqlTraceFlag.psm1, line 152 at r4 (raw file):
4>$null
Let us remove this so this won't be a problem when we fix issue #1564.
Kicked off the tests again. |
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: 0 of 3 files reviewed, 8 unresolved discussions (waiting on @Fiander and @johlju)
tests/Unit/DSC_SqlTraceFlag.Tests.ps1, line 170 at r5 (raw file):
-MockWith {return}
We can skip this part if we should not return anything. It is enough with Mock -CommandName Import-SQLPSModule
tests/Unit/DSC_SqlTraceFlag.Tests.ps1, line 357 at r5 (raw file):
-MockWith {return}
We can skip this part if we should not return anything. It is enough with Mock -CommandName Import-SQLPSModule
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: 0 of 3 files reviewed, 8 unresolved discussions (waiting on @Fiander and @johlju)
CHANGELOG.md, line 9 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
.·
Remove full stop (
.
) here, there is already (correctly) a full stop after the issue link.
Done.
source/DSCResources/DSC_SqlTraceFlag/DSC_SqlTraceFlag.psm1, line 36 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
#Import SqlServer module but suppress verbose message.
We should have a space after the
#
,# Import...
.
Done.
source/DSCResources/DSC_SqlTraceFlag/DSC_SqlTraceFlag.psm1, line 37 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
4>$null
Let us remove this so this won't be a problem when we fix issue #1564.
Done.
source/DSCResources/DSC_SqlTraceFlag/DSC_SqlTraceFlag.psm1, line 151 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
#Import SqlServer module but suppress verbose message.
We should have a space after the
#
,# Import...
.
Done.
source/DSCResources/DSC_SqlTraceFlag/DSC_SqlTraceFlag.psm1, line 152 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
4>$null
Let us remove this so this won't be a problem when we fix issue #1564.
Done.
tests/Unit/DSC_SqlTraceFlag.Tests.ps1, line 170 at r5 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
-MockWith {return}
We can skip this part if we should not return anything. It is enough with
Mock -CommandName Import-SQLPSModule
Done.
tests/Unit/DSC_SqlTraceFlag.Tests.ps1, line 357 at r5 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
-MockWith {return}
We can skip this part if we should not return anything. It is enough with
Mock -CommandName Import-SQLPSModule
Done.
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 3 files at r5, 1 of 1 files at r6.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Fiander)
@Fiander thank you for this fix! Much appreciated you took the time! 😃 I will shortly push a PSSA rule soon that will help detect these kind of issues in the future. |
Pull Request (PR) description
SMO was not imported correctly. Fixed by importing sql smo.
This Pull Request (PR) fixes the following issues
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
This change is