Giter VIP home page Giter VIP logo

Comments (6)

luisdavim avatar luisdavim commented on June 15, 2024 2

I believe sensu-plugins-dcos is covered.

from community.

barryorourke avatar barryorourke commented on June 15, 2024 1

sensu-plugins-load-checks can be ticked of now.

from community.

majormoses avatar majormoses commented on June 15, 2024 1

This is actually a subset as it has probably not been updated for any new plugins added since it's creation but yes there are 180+ plugins. It is a very large effort to push this kind of testing across all the plugins. I will have some blog posts coming out talking about this.

from community.

majormoses avatar majormoses commented on June 15, 2024 1

I need to create something a bit more formal in the form of a best practices doc but between the following links I think is a good start while I work on writing this up better:

Also I have added the example you mentioned to the skel along with the skeleton of all the framework config. I think this is a very good start for now.

As far as things to test I think that really depends on the particular plugin so we might want to make individual issues for more specific things But I think there are a few universal things to check:

  • is each check executable and has a working ruby environment? See a shared example and it's invocation
  • do passing conflicting args/config through an unknown|3?
  • Each check/metric, handler, mutator should probably have a min of 1 positive (returns ok|0) check and another to demonstrate that say a critical|2 or |warning|1 threshold is met. Certainly no hard rule and ideally there will be more checks for more things but I find that just doing something makes it easier for people to grok what you want when you ask them to add tests if there are already tests in the repos.

If I had to start in a new repo I find the easiest ones to work with are the high level checks like ping, alive, healthy, etc. It usually requires the least amount of effort to bootstrap/mock and test. This sets the stage without figuring out how to do multi master postgres replication. While eventually we will want this eventually start with the simplest of use cases. The more complicated stuff will come when people start seeing the value of the tests failing when they break stuff.

I have linked a few examples in this issue as well. I'd like an actual doc in addition to the blog posts, skel enhancements, and the few I have done so far is what I have time for right now. Maybe next week I will start creating this more formal document with more examples and talking about what types of things to test but there is some of that in the blog posts already.

One more thing to add is to start looking at your actual check definitions and try to write a test for each one with those options (not necessarily the values but exercising the options). If even 10% of people using plugins did this we would have crazy good coverage. Ideally we would cover every option but I suggest testing either what you are doing (being selfish is ok on this matter) or to distill the most common use cases. Ones that are super generic like check-http.rb might be a little hard to start thinking about as there are so many things to check but I am available to shed some light on a per case basis until we have done enough analysis across all the plugins to come up with a better list of things to check. The best tests are basically just using them like you would in production. If you have to tell your test to do funky things then it is probably not the best test as you are already changing what you are doing from production. One of the reasons I wrote those tests like that is because that how you would actually test it manually. You would create some DNS records and then check for the ones you want the same as cli or through a sensu check definition.

from community.

absolutejam avatar absolutejam commented on June 15, 2024

This list amazes me. Didn't realise there were so many.

from community.

absolutejam avatar absolutejam commented on June 15, 2024

@majormoses is there a good place to provide some example tests or things to test?

I know one example that would have helped me when I was trying to get to grips with both Ruby and rspec for a PR I submitted is check-dns-shared. The tests for CLI args are really clear and concise (And I'm determined rewrite mine to match, haha), but they act as a great sanity check that anyone can write.

from community.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.