action #109620
Updated by livdywan over 2 years ago
os-autoinst: Improve unit-test code coverage for backend::svirt ## Motivation https://app.codecov.io/gh/os-autoinst/os-autoinst/blob/master/backend/svirt.pm shows that we have at time of writing just 43% statement coverage and multiple methods are not fully covered. Before we go about extending features or fixing bugs we should ensure with better test coverage that we are less likely to introduce regressions and ease development (e.g. for #106685). ## Acceptance criteria * **AC1:** 100% statement coverage reported in https://app.codecov.io/gh/os-autoinst/os-autoinst/blob/master/backend/svirt.pm ## Suggestions * Look into t/22-svirt.t, call it locally to get coverage, e.g. `make coverage TESTS=t/22-svirt.t`, maybe some other tests on top * Look into the interesting challenge why the above command does not seem to provide any coverage for the file backend/svirt.pm at all (at least for okurz) * Optionally add a new unit-test level test file, e.g. based on t/29-backend-amt.t * Add test (with mocking) for existing code in backend/svirt.pm until a sufficiently high statement coverage is reached