tmt clean guest --keep doesn't prune the workdir
Reproducer:
(dev) lnie@fedora:~/tmt$ tmt clean -vvv guest --keep 1
clean
guests
workdir root: /var/tmp/tmt
Stopping guests in run '/var/tmp/tmt/run-002' plan '/plans/testcloud'.
cleanup
queued cleanup task #1: default-0 on default-0
cleanup task #1: default-0 on default-0
how: tmt
order: 50
guest: stopped
guest: removed
Skipping workdir prune as requested.
summary: 1 task completed
tmt should not "Skipping workdir prune as requested.".
The problem is that self.plan.my_run.opt('keep'),due to there are --keep option both in run and clean guest, I guess we should rename the run.--keep:)
Yeah, the tmt run --keep and tmt run cleanup --keep options should not collide. Looks like a bug which should be fixed.
From the hacking session, we need to confirm which --keep we need to rename. The tmt run --keep we expect to be more regularly used and the cleanup --keep is more of an accidental name collision, but we need to double-check with the code.
I was distracted and didn't manage to say 😅 : we have --keep option for tmt clean, tmt clean run, that's the reason why I chose change the run.--keep, but yeah, we need change many tests in that way,I don't have strong opinion on this:)