[feat]: Add testing bootstrap code for templates
uberspot opened this issue · 1 comments
Description of the feature
Hey legends! :)
We were using kapitan and got a request from some devs writing templates in it for a nice/quick way of testing template code.
Testing functionality is easy with a test target for example, but testing cases that should fail is trickier if you want kapitan compile to still compile all targets.
Is anyone else doing something similar?
Otherwise it sounds like a feature we could add to kapitan to e.g. call pytest if a flag is passed before compiling but after creating the inventory internally (?).
Additional context
No response
We could also add a flag in the target allow_failure
, so that the target doesn't require to compile. Then you would need to check for your expected result (compiled or not) afterwards.
Embedding pytest or another test framework would need much more library support, which includes interfaces, modularity and API interface instead of setting the argvector and calling main()