kubectl-trace icon indicating copy to clipboard operation
kubectl-trace copied to clipboard

Descriptive testing

Open leodido opened this issue 6 years ago • 2 comments
trafficstars

I'd like to propose a descriptive testing of the CLI testing.

Inspiration come from the Go project.

Eg.,

  • https://github.com/golang/go/blob/master/src/cmd/go/testdata/script/run_hello.txt
  • https://github.com/golang/go/blob/master/src/cmd/go/testdata/script/clean_testcache.txt

This would simplify the readability of tests, but also it would simplify their writing.

Related to #25.

leodido avatar Jan 31 '19 18:01 leodido

This idea is awesome, do you think we can do that even for integration? There's already a framework but we only implemented a single test so it would be easy to adapt the kind part and use this

fntlnz avatar Jan 31 '19 21:01 fntlnz

Everything's possible Lore :)

Anyways, I'd like to use this approach (at least as first step) to "describe" and test the input/output of kubectl-trace commands, as I've done in other tools we've done during the last year.

I verified such approach works really well for CLIs.

Then, we can extend this approach also to other kind of software verification/testing.

WDYT?

leodido avatar Oct 28 '20 00:10 leodido