kyua icon indicating copy to clipboard operation
kyua copied to clipboard

Need a means to save temporary generated directories on failure

Open ngie-eign opened this issue 10 years ago • 3 comments

In the event a test fails, there isn't a means for testers to recover necessary data in order to determine why an issue occurred in all cases.

It would be nice if there was a configurable hook in kyua where a set of arbitrary commands could be executed on cleanup to save a the directories, there was a configuration variable where the directory could be saved, etc...

ngie-eign avatar Mar 27 '15 04:03 ngie-eign

My idea for this was to extend kyua debug with an option to keep the contents if desired. E.g. doing kyua debug --workdir=/tmp/foo some-test would force Kyua to use that work directory and not clean it up on exit.

However, I'm not sure that'd be sufficient. Especially because this requires a re-run of the test.

We could go one step further and support something like kyua test --workdir=/tmp/foo, which would cause us to run all tests and only keep work directories for the tests that failed.

In other words: if no --workdir is provided, Kyua picks a temporary directory on its own and makes sure it's fully wiped on exit. If the user provides his own directory, it is not automatically cleaned up for failures. Makes sense?

jmmv avatar Apr 13 '15 18:04 jmmv