Hi,
I'd like to enquire if it's desired to let runtask exit with '1' if the
task in question has a 'FAILED' outcome.
Maybe there was a conscious decision of not providing this feature and
I'd like to hear about it.
I've joined Taskotron on phabricator. If there are no obvious
resentments against such an idea, I'm happy to create a task and
implement it.
Kind Regards,
--
Róman Joost
Hey Róman,
thanks for joining the project and welcome :)
We have never really thought about the feature you're talking about. We currently
return non-zero in case the execution fails - ctrl+c, an exception thrown. If we wanted to
extend it to the FAILED task result, I see the following issues:
1. We have other outcomes defined at the moment, like NEEDS_INSPECTION:
https://docs.qadevel.cloud.fedoraproject.org/libtaskotron/latest/library....
What should happen in that case?
2. Some tasks do not check just a single item. For example, depcheck and upgradepath check
everything that is currently proposed for stable or testing updates. They can return a
dozen test results. What should happen when there are mixed results?
3. At the moment, it's technically possible to leave out the 'resultsdb'
directive the from task recipe. I cannot imagine a use case for this, because in
development mode, this only reports to stdout, but it's possible if you need it. If we
wanted to inspect task outcomes, we need to do it from TAP, therefore in the
'resultsdb' directive. It might be confusing to people that if you commented out
that directive, runtask would stop returning "correct" return codes.
One further thought, instead of implementing this by default, we can also create a new
directive or variable which will allow task creators to set the exit code, according to
TAP or any other logic they want.
Why exactly do you need this? For local testing? runtask is just an execution wrapper, so
you should be able to run your `./script some args` the same way as `runtask -i item -t
type script.yml`. Except for some set up steps (like 'koji' or 'bodhi'
directive), so if you use some of these, I can see a reason why you would want to run it
through runtask.
Kamil