Update to use DSCResource.test Shared Code - Fixes #177 - #186
Conversation
|
@tysonjhayes - I have updated this PR with the new MetaTestOptIn.json file to opt in to the Markdown and Example tests. Everything should be good to go now. |
| [ | ||
| "Common Tests - Validate Markdown Files", | ||
| "Common Tests - Validate Example Files" | ||
| ] No newline at end of file |
There was a problem hiding this comment.
missing newline at end of file
|
Reviewed 10 of 11 files at r1, 1 of 1 files at r2. appveyor.yml, line 12 at r2 (raw file):
Question: Couldn't we make this function generic in the future, the same name for all resources that uses Harness? Like .vscode/RunAllTests.ps1, line 2 at r2 (raw file):
This one expects the DscResource.Tests to already been cloned? What if it isn't? Tests/xNetworking.TestHarness.psm1, line 6 at r2 (raw file):
Could we format these two parameters like Tests/xNetworking.TestHarness.psm1, line 13 at r2 (raw file):
Single quotes Tests/xNetworking.TestHarness.psm1, line 17 at r2 (raw file):
Could this happen? Shouldn't DSCResource.Tests always end up outside DSCResources folder? If not, then code in RunAllTests.ps1 won't work. :) Comments from Reviewable |
|
@johlju - regarding the name of the name of the harness invoke call. I fully agree - a consistent name would be much better here. I can change xNetworking and xStorage. The question will be down to @BrianFarnhill: Brian are you ok with changing the name of your Invoke-SharePointDscTests function to a generic name? I'll look at the rest of the comments tomorrow! Thanks for reviewing @johlju |
|
@johlju - I've been thinking about this and I think we should default the name of the Harness function to I'll submit a PR with the changes to DSCREsource.tests and also to xNetworking and xStorage. |
|
Review status: 8 of 11 files reviewed at latest revision, 6 unresolved discussions. appveyor.yml, line 12 at r2 (raw file): Previously, johlju (Johan Ljunggren) wrote…
Done. I've submitted the PR to DSCResource.Tests. Once that is through this will start working. Note, I used: [Parameter()] |
|
Reviewed 4 of 4 files at r3. Comments from Reviewable |
Codecov Report
@@ Coverage Diff @@
## dev #186 +/- ##
====================================
Coverage ? 95%
====================================
Files ? 15
Lines ? 1113
Branches ? 0
====================================
Hits ? 1068
Misses ? 45
Partials ? 0Continue to review full report at Codecov.
|
|
95% code coverage impressive. You can explore the code coverage per file in the branch view. |
|
Reviewed 3 of 4 files at r3, 4 of 4 files at r4. .codecov.yml, line 20 at r4 (raw file):
Minor: Maybe raise target on this repo? Comments from Reviewable |
|
Our HQRM guidelines are for 70%. There is evidence that higher targets are not always better (although most of those assumed integration tests were not included in the goal.) I would not raise it above 80. Currently, the other option ( |
|
@TravisEz13 I'm good with 70% if that is the guideline. But I thought we could use this check to fail if a new resource got the limit under 95% (in this repos case). |
|
Aha I see! I did not see the |
|
Review status: Comments from Reviewable |
|
@johlju , @TravisEz13 - I'm ok with lowering the threshold to a lower value. We could try say 2% and see how that goes. @tysonjhayes ? |
|
@PlagueHO That sounds good. We should just remember to treat it with reason. It's all very new. |
|
Wouldn't lowering the threshold value increase the amount of code coverage needed? So new resources would have to meet the 95+/- 2% code coverage needed before they could be submitted? Seems like a tall order. |
|
Threshold says that a PR that is - |
|
@PlagueHO Sorry for being late to the party here, had a busy week. To answer the question of me, nah I don't mind using a generic name at all for the test suit. I'm happy to play nice with others on this one, no biggy at all. |
|
No worries @BrianFarnhill mate! I actually changed it so you can use a generic name or override it with your own one by specifying parameter values (AppVeyor.yml is smaller if you use generic). |
|
@tysonjhayes , @TravisEz13 - perhaps we should leave xNetworking threshold as is for now and see how things go. I guess the whole codecov thing is a bit new (at least to these repos) so we might want to monitor for a bit. |
|
@PlagueHO It is probably better to be a bit cautious in the beginning. This is why I set 70% project requirement and 5% threshold. It seemed to give a good amount of wiggle room while telling people when they met the project goals. |
|
Ok - I think we should just leave it as is and merge it. @TravisEz13, @tysonjhayes - are you happy for me to merge? |
|
@johlju, I think there is still one unreviewed file... Review status: 12 of 13 files reviewed at latest revision, all discussions resolved. Comments from Reviewable |
This PR changes:
This also fixes #177
This change is