gpestana / kapacitor-unit

Testing framework for Kapacitor TICKscripts
MIT License
75 stars 19 forks source link

Test tick scripts using node output #11

Open gpestana opened 7 years ago

gpestana commented 7 years ago

What

Kapacitor features node outputs, in which processed data from kapacitor can be output to a certain service. Kapacitor has two types of node output implemented out of the box and ready to use: HTTPOutputNode and InfluxOutputNode. It is also possible to define custom output nodes. TICKscripts which process data and output it to a certain endpoint may or may not trigger alerts.

It would be a great feature for kapacitor-unit to test node outputs.

Test flow:

0) Define the test configuration (which data to load, which tick script to load, what are the output expected after the data processing) 1) Load tick script 2) Load task 3) Inspect output data 4) Compare expected data with output data

Open points

A) How to pipe data coming from an output node to inspect its contents and compare with the expected data defined in the test definition? kapacitor-unit should be able to consume processed data coming from any type of NodeOuput, predefined or custom.

B) How would the test definition look like?

C) Add way to split configuration tests so that it's easier to manage them? (e.g. to have a test configuration for alerts and another for data processing (OutputNode) type of tests.

smolse commented 7 years ago

There is also HTTPPostNode whose output might need to be tested.

vlaurenzano commented 5 years ago

I am currently working on changes that will allow for out node testing. I'm starting with the log node.