sensu / sensu-chef

Sensu Chef cookbook.
https://supermarket.chef.io/cookbooks/sensu
Apache License 2.0
222 stars 283 forks source link

sensu check cron scheduling support #612

Closed vbichov closed 5 years ago

vbichov commented 6 years ago

adds cron configuration to sensu checks

Description

Added the code relevant to check configuration and some tests

Motivation and Context

fixes #551

How Has This Been Tested?

Added relevant test

Screenshots (if appropriate):

Types of changes

Checklist:

majormoses commented 6 years ago

Thanks for your contribution to Sensu Chef! Without people like you submitting PRs we couldn't run the project. I will review it shortly.

vbichov commented 6 years ago

hi @majormoses I'm trying to change the behaviour as per your request but failing to run the tests.

It seems that chef_run in check_spec.rb interacts with the generated resource and not the resource provider (basically the code in providers/check.rb is not executed as far as the tests are concerned). The result is that the attributes are not deleted when running rake, and tests fail.

Any Ideas on how to overcome this ?

majormoses commented 6 years ago

I tend to focus my efforts on integration tests rather than unit tests with chef as I find them to be much more reliable testing. I see several of your integration tests are probably failing because you typo'd interval. I will take a closer look at the unit tests and see if I can figure out whats going on.

majormoses commented 6 years ago

I would say if you have integration tests feel free to remove the corresponding unit tests. If they were a library function it would make more sense to write a unit test for it.

vbichov commented 6 years ago

Hi, Fixed the issues - tests pass.

majormoses commented 5 years ago

Sorry this fell off my radar. I will work on merging, writing up a changelog entry, and cutting a release.

majormoses commented 5 years ago

released: https://supermarket.chef.io/cookbooks/sensu/versions/5.3.0