rpm-software-management / libcomps

Libcomps is alternative for yum.comps library. It's written in pure C as library and there's bindings for python2 and python3.
GNU General Public License v2.0
29 stars 37 forks source link

tests: Don't print parsing errors during tests #107

Closed pkratoch closed 1 year ago

pkratoch commented 1 year ago

The tests are unnecessarily chatty and print many errors that are actually expected. In case of unexpected errors, it wouldn't print all of them anyway, and would need to be enabled, since there are other parsers initialized to not print the logs.

jan-kolarik commented 1 year ago

Thanks for that. Although there is still a DTD validating involved, which is sadly doing the printing on its own, it would need some effort and API modifications to make it consistent with other comps_parse_* functions.

jan-kolarik commented 1 year ago

Thanks for that. Although there is still a DTD validating involved, which is sadly doing the printing on its own, it would need some effort and API modifications to make it consistent with other compsparse* functions.

@pkratoch Or if you think we can just drop that printf from there? Because it's now used just in the unit test within libcomps. And the headers are IIUC just for developmental purposes.

pkratoch commented 1 year ago

Thanks for that. Although there is still a DTD validating involved, which is sadly doing the printing on its own, it would need some effort and API modifications to make it consistent with other compsparse* functions.

@pkratoch Or if you think we can just drop that printf from there? Because it's now used just in the unit test within libcomps. And the headers are IIUC just for developmental purposes.

Hm, I am not sure what all components use this and if removing the printf wouldn't cause problems elsewhere. It seems safer to print the error during tests than not to print the error when there would be actual problem. And regarding the modification to respect the log->std_out, I am not sure if the effort is worth it, especially given how low severity the issue is.