testkube
testkube copied to clipboard
Add json output to kubectl testkube run test
Describe the enhancement you'd like to see We would like to parse extraction id after running kubectl testkube run test xxx. Current run test displays a plaintext output, which can be parsed, but is not as safe as json parsing. Would it be possible to add json output for run test?
Hey, @marcportabellaclotet-mt We support output format for certain commands and object type. For example, kubectl testkube get execution --output=json
, but not for Run command. But we can add it for run command as well
Thanks, that will be very appreciated!!
You're welcome @marcportabellaclotet-mt Definitely, it will be a nice improvement for automation of test based workflows, we will add it to our task list
I think we should plan to rewrite UI package - rethink it in terms of errors and output formats. For now we can just put some ifs but on the very end it should be pluggable in some kind
Hi @marcportabellaclotet-mt maybe something like this for now will be enough?
tk run test kubeshop-cypress | grep "Execution ID:" | tr -s ' ' | cut -d ' ' -f 4
Hi @exu , Yes, we are already parsing the execution Id using bash tools. However, this usually breaks pipelines when output format changes, and we prefer to relay on json format. Thanks for comments @exu!! Great tool!!
Would it make sense that for the testkube run command we have these fields are json output ?
fields for json output:
- status: passed/failed
- logs: ""
- executionid: ""
- etc....
@jmorante-ks @dejanzele @vsukhin @rangoo94 could you define a good json output spec for our CLI command ?