Closed antonidabek closed 6 years ago
Thanks for your contribution to Sensu plugins! Without people like you submitting PRs we couldn't run the project. I will review it shortly.
OK, is there a PR where I could see example of test being added?
I think there is no automated tests if I get code correctly in this repo, I will add them in separate PR. It seems that https://github.com/geku/docker-client has work done on exposing Docker API to tests.
For pretty much everything else I have been using test-kitchen
with kitchen-docker
as a driver but that poses the issue of docker in docker so I am not sure but I'd like to see what kind of options we have to keep the toolset as similar as possible. Here is a blog post I put together on integration testing for plugins. Even if you end up selecting different tools it is still a good read about writing clean integration tests in general. Let me know if I can be of any help.
I added some test, I guess please though look first at #63 where is the code to start docker in docker.
I left a comment regarding the testing over there it looks good just one tweak. Would you rather adding the base testing in the other PR and then rebase this one or would you prefer to do it all here? Either way is fine with me as long as we are not doing the exact same thing in both places.
I will rebase this one :-)
@antonidabek I merged the other and will review after you rebase and fix conflicts.
I rebased patch, updated changelog and added one more test case.
In some cases docker containers would be used on demand or started periodically to execute certain tasks. Option -x would allow to monitor them and only raise alerts if they have exited with error (status code different from zero).