kapacitor-unit icon indicating copy to clipboard operation
kapacitor-unit copied to clipboard

Support for providing the script path in yaml

Open vhartikainen opened this issue 6 years ago • 2 comments

It would be helpful to provide the relative tick script path in the configuration YAML if wanted. Such would make it possible to just pass the root tests directory on command line and then have the relative path in config yaml.

e.g.

scripts
+- scripts1
     +- script1.tick
+- scripts2
     +- script2.tick
tests
+- test1.yaml
+- test2.yaml

Then having in test1.yaml

...
   task_name: scripts1/script1.tick

And running: kapacitor-unit --dir scripts --tests tests/test1.yaml

I will add another improvement for just providing a tests directory and then iterating over all test yaml configs in there :)

vhartikainen avatar May 30 '18 12:05 vhartikainen

The cli is already reading all .tick scripts in a directory and running those.

e.g. kapacitor-unit --dir /some/test_dir [...] will read all .tick scripts under /some/test_dir

@vhartikainen, if I understood your suggestion correctly, this is already implemented? Or am I m issing anything? Thanks!!

gpestana avatar Jun 04 '18 14:06 gpestana

Actually what I was looking for was to: either a) gather all .tick scripts recursively from all subdirectories under the given --dir /some directory

or b) have the tool to understand relative paths in the config file, like when defining --dir scripts and in yaml having that task_name: scripts1/script1.tick for a .tick script that would be located in scripts/scripts1/script1.tick

vhartikainen avatar Jun 05 '18 08:06 vhartikainen