-
Notifications
You must be signed in to change notification settings - Fork 682
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
Add windows support to the processes
resource
#1878
Add windows support to the processes
resource
#1878
Conversation
@username-is-already-taken2 really loving your contributions - keep 'em coming! Regarding casting the CPU/memory to numbers - you are correct that this could potentially be backward incompatible depending on how users have written their profiles. Hopefully, it wouldn't be (calling Our recommendation to users would be use the |
006f5ff
to
bff0a54
Compare
Thanks for the contribution Gary! https://github.com/chef/inspec/blob/v1.26.0/test/helper.rb#L186 https://github.com/chef/inspec/blob/v1.26.0/test/unit/mock/cmd/get-package-firefox |
e432ec3
to
efbd96b
Compare
Thanks very much @alexpop Appreciate your help. I'm building a list of things I want to add to I've added a some unit tests for windows to the
Yet I know the resource does work :(
If I'm honest, I'm a little out of my depth with unit testing, I don't know if its my test or my resource :( Anyone willing to help me out ? |
I think its something to do with the way the command get mocked, when the cmd is called and it reads in my sample data from humm..... back to the drawing board.
|
878bcee
to
ab651c0
Compare
@username-is-already-taken2 this is coming along quite nicely! How can we help you at this point? |
ab651c0
to
4aa3ed6
Compare
Signed-off-by: username-is-already-taken2 <digitalgaz@hotmail.com>
4aa3ed6
to
9d9baeb
Compare
processes
resourceprocesses
resource
Well @adamleff I think I'm there. Been a bit of a labour of love and such a learning experience :) I think this is now ready for review. |
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.
Another great contribution, @username-is-already-taken2!
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.
Amazing contribution, thank you Gary @username-is-already-taken2 !! 🎆
Also kudos @adamleff and @alexpop for your reviews and support 😄
Hi
This PR is my attempt to really fix #1851 rather than patch it, by adding windows support.
I've also added an
exists
method as I found it useful.Add support for Windows
Add Exists Method
Create unit tests to include windows runner
Update the docs to include the an example for Exists
Update the docs to provide a windows example
Exists Method example...
Any comments or feedback is appreciated.
Question regarding converting strings
Don't know if anyone has an opinion but I thought it was better to convert the cpu and memory stats to numbers to make it easier to use is something like is it greater than a number rather then use a regex to parse a string? (Hope that makes sense :) I saw that the pid,vsz,rss where already converted.
but thought it could be a breaking change which is why they are only converted on windows. Happy to strip out.
Well let me know what you think, happy to start work on the tests (something else to learn :)
Gary