Skip to content
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

xWebsite Inconsistent Logic in xWebsite #566

Conversation

RandomNoun7
Copy link
Contributor

@RandomNoun7 RandomNoun7 commented Feb 19, 2020

Pull Request (PR) description

The Test-TargetResource function in the xWebSite resource used
inconsistent logic in the way that it would test a property for
compliance and then report non-compliance.

Some tests would use the $PSBoundParameters variable to check for
parameters to be tested, others would use [String]::isNullOrEmpty()

Some tests would set the $inDesiredState variable, write a verbose
message and move on, and others would write the verbose message and
use the return keyward to immediately exit the function and stop
testing additional properties.

The desired style should use $PSBoundParameters and the
$inDesiredState variable consistently, so that all properties are
tested for troubleshooting purposes, and to promote conciseness and
reasability

This Pull Request (PR) fixes the following issues

Resolves #221

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@RandomNoun7 RandomNoun7 force-pushed the ghissues/221-inconsistent-logic-xwebsite-test-resource branch from e2e8428 to 91c5357 Compare February 19, 2020 14:52
@RandomNoun7
Copy link
Contributor Author

These test failures don't look like they are related to the changes made in the PR.

@johlju johlju added the needs review The pull request needs a code review. label Feb 19, 2020
@RandomNoun7 RandomNoun7 force-pushed the ghissues/221-inconsistent-logic-xwebsite-test-resource branch 8 times, most recently from db7e107 to d9ed771 Compare February 21, 2020 19:50
@RandomNoun7 RandomNoun7 force-pushed the ghissues/221-inconsistent-logic-xwebsite-test-resource branch from d9ed771 to 59e8dcc Compare February 21, 2020 20:14
@RandomNoun7 RandomNoun7 reopened this Feb 21, 2020
@RandomNoun7 RandomNoun7 force-pushed the ghissues/221-inconsistent-logic-xwebsite-test-resource branch 4 times, most recently from 8c35ce7 to b8255da Compare February 21, 2020 23:09
@RandomNoun7
Copy link
Contributor Author

Waiting on #568

@RandomNoun7 RandomNoun7 force-pushed the ghissues/221-inconsistent-logic-xwebsite-test-resource branch 2 times, most recently from 0cf416c to bd4dab4 Compare February 27, 2020 19:10
@RandomNoun7
Copy link
Contributor Author

Turned out this was also waiting on #565.
With that issue resolved this has been rebased and as soon as the tests pass (hopefully they pass), this will be ready to merge.

The Test-TargetResource function in the xWebSite resource used
inconsistent logic in the way that it would test a property for
compliance and then report non-compliance.

Some tests would use the `$PSBoundParameters` variable to check for
parameters to be tested, others would use `[String]::isNullOrEmpty()`

Some tests would set the `$inDesiredState` variable, write a verbose
message and move on, and others would write the verbose message and
use the `return` keyward to immediately exit the function and stop
testing additional properties.

The desired style should use `$PSBoundParameters` and the
`$inDesiredState` variable consistently, so that all properties are
tested for troubleshooting purposes, and to promote conciseness and
reasability

Resolves dsccommunity#221
@RandomNoun7 RandomNoun7 force-pushed the ghissues/221-inconsistent-logic-xwebsite-test-resource branch from bd4dab4 to e7da5b9 Compare February 27, 2020 20:53
@RandomNoun7
Copy link
Contributor Author

Ok, that had a transient failure, but this is fully rebased and tests passing. Ready to go.

Copy link
Member

@regedit32 regedit32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@regedit32 regedit32 merged commit 29e27ee into dsccommunity:master Feb 28, 2020
@RandomNoun7 RandomNoun7 deleted the ghissues/221-inconsistent-logic-xwebsite-test-resource branch February 28, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review The pull request needs a code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent Logic in Test-TargetResource for xWebsite
3 participants