teemtee / tmt

Test Management Tool
MIT License
76 stars 112 forks source link

RFE: [tmt lint] add a warning class to handle "warn: Empty environment file" #2872

Open bgoncalv opened 4 weeks ago

bgoncalv commented 4 weeks ago

In our repo we have a lot of tests that when running tmt lint shows warn: Empty environment file

It would be nice if we could force tmt lint to report failure in this cases, afaik it is not handled as a warning class.

My suggestion would be running a command like below would force the lint to report failure.

tmt lint --outcome-only fail --enforce-check Cxxx .
psss commented 4 weeks ago

For this specific case, when environment-file is pointing to an empty file, I would say we should even give a failure by default. Could be a good first issue, here's an example plan check:

https://github.com/teemtee/tmt/blob/22731b9761b62177de00ee7818c2f0ee4efcfe03/tmt/base.py#L2027-L2039

happz commented 4 weeks ago

FTR, can be done for environment-file keys in a plan only, it wouldn't catch the runtime (run --environment @empty.yaml). But should be a nice and easy check.