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

Return arrays for wmi properties #5314

Merged
merged 2 commits into from
Dec 2, 2020
Merged

Return arrays for wmi properties #5314

merged 2 commits into from
Dec 2, 2020

Conversation

alexpop
Copy link
Contributor

@alexpop alexpop commented Nov 23, 2020

Related Issue

Fixes #5313

Types of changes:

  • Bug fix (non-breaking change which fixes an issue)
  • New content (non-breaking change)
  • Breaking change (a content change which would break existing functionality or processes)

Braking change:

Tests for the wmi resource that used the eq matcher without an array expected value, for example:

describe wmi({:namespace=>"root\\cimv2", :query=>"SELECT installstate FROM win32_optionalfeature WHERE name = 'SMB1Protocol'"}) do
  its("installstate") { should eq 2 }
end

will need to upgrade to an expected array value, for example:

  its("installstate") { should eq [2] }

or use the cmp matcher instead of eq

  its("installstate") { should cmp 2 }

As a bonus, the resource is now compatible with a new includes matcher:

  its("installstate") { should includes 2 }

Checklist:

  • I have read the CONTRIBUTING document.

@alexpop alexpop requested a review from a team as a code owner November 23, 2020 21:47
@netlify
Copy link

netlify bot commented Nov 23, 2020

Deploy preview for chef-inspec ready!

Built with commit 9438c81

https://deploy-preview-5314--chef-inspec.netlify.app

@chef-expeditor
Copy link
Contributor

Hello alexpop! Thanks for the pull request!

Here is what will happen next:

  1. Your PR will be reviewed by the maintainers.
  2. Possible Outcomes
    a. If everything looks good, one of them will approve it, and your PR will be merged.
    b. The maintainer may request follow-on work (e.g. code fix, linting, etc). We would encourage you to address this work in 2-3 business days to keep the conversation going and to get your contribution in sooner.
    c. Cases exist where a PR is neither aligned to Chef InSpec's product roadmap, or something the team can own or maintain long-term. In these cases, the maintainer will provide justification and close out the PR.

Thank you for contributing!

Copy link
Contributor

@Schwad Schwad left a comment

Choose a reason for hiding this comment

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

This looks good to me, @alexpop. I see there's a spec failure we have. Might be worth having a chat with @kekaichinose to get his +1 on it with regards to the customer and possible breaking elements. thanks!

Signed-off-by: Alex Pop <apop@chef.io>
Signed-off-by: Alex Pop <apop@chef.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wmi resource can't handle select statements with multiple objects returned
2 participants