stefanprodan / timoni

Timoni is a package manager for Kubernetes, powered by CUE and inspired by Helm.
https://timoni.sh
Apache License 2.0
1.54k stars 68 forks source link

Feature Request: Values.cue Debugging scenarios #410

Closed richardpj closed 3 months ago

richardpj commented 3 months ago

I have tried timoni out by re-implementing one of our existing helm charts. The syntax is succint and precise. Really brilliant!

I have a number of complex values.cue validation scenarios. They work well in timoni but they are difficult to test. Especially as the cue validation step is bailing on the first error. I'm considering refactoring my debug values to template a number of both positive and negative scenarios.

I could write a validation script in bash to then run the scenarios and assert but I feel like this is something that could be achieved by modifying the behaviour in debug_tool.cue to enable listing a number of positive and negative scenarios and asserting.

richardpj commented 3 months ago

I see that this is a limitation in cue _tool scripts and has nothing to do with timoni. Positive scenarios are fine. Negative scenarios not possible. I guess I'll shell execute those in my debug_tool.cue for now.

stefanprodan commented 3 months ago

Can you say more about negative scenarios? Are you testing for exit codes of the cue vet?

richardpj commented 3 months ago

Yes exactly, that's the plan. I'm busy trying a few things. I can publish a repo once I have something if you're interested..?