问题描述:

We use Jenkins for a wide variety of automated testing and monitoring tasks as well as testing code.

The main reason we do this is so that we can use multiple Jenkins' plugins and tools - things like email notification, the Web interface and the API for seeing test results, chaining other tasks, logging errors, etc.

Many of these tests boil down to one or two SQL queries which we run very day/every 5 minutes/every whatever against one of our main DBs. Usually we are looking for zero rows of results to show that everything is fine, sometimes we want 'no more than 30 rows' or 'at least 10 results'. Rarely do we do more detailed analysis of the results - we can usually roll it into the SQL.

This means that we have a bunch of wrapper scripts which connect to a DB, run a query, and decide if the results are ok or not. For various historical reasons no two of these scripts are the same and they all run/generate output/load configuration slightly differently. We would like to cut out all these scripts, and just keep a bunch of SQL queries around. We would also like to be able to manage all the database configuration in one place rather than have each script load config files or have hard-coded connection details, etc.

Is there:

  1. A way of doing this in Jenkins - similar to the language plugins which allow you to write eg. R code directly into a Job configuration?
  2. Some other tool which runs SQL queries periodically, and reports results, sends notifications, etc. ?

We could probably roll our own - but it would be much better to have a stable out-of-the-box solution if one exists.

相关阅读:
Top