Unit test coverage improvement in BMO
lentzi90 opened this issue · 14 comments
Improve the unit test coverage by writing new test cases or completely new tests. Check the current coverage with make unit-cover
.
Here are some suggestions on where to start. Note that some functions are harder to test than others because they may depend on access to network resources or a database. If you come across such function, skip them and aim for the low hanging fruits instead.
- features.go has no tests at all and looks quite simple to test. Fixed in #1579
- loadTLSConfigFromEnv is untested and should be easy to test. Fixed in #1589 or #2013
- baremetalhost_types.go has multiple small functions without coverage that could easily be tested. Fixed in #1615
- bmceventsubscription_controller.go has no tests at all. Fixed in #1615
- preprovisioningimage_controller.go has no tests at all. Fixed in #2013
- LoadAuth is untested. Fixed in #1774
- client.go has no tests at all. Fixed in #1606
/triage accepted
/good-first-issue
@lentzi90:
This request has been marked as suitable for new contributors.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue
command.
In response to this:
/triage accepted
/good-first-issue
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/reopen
@lentzi90: Reopened this issue.
In response to this:
/reopen
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/assign NeerajNagure
/reopen
There are a few items in the list still
@lentzi90: Reopened this issue.
In response to this:
/reopen
There are a few items in the list still
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/assign babugeet
@lentzi90 : pls review the above PR
The provided test cases cover the following scenarios for the LoadAuth function:
No Authentication Directory Exists:
Test Case: NoAuthDirectory
Description: Tests the scenario where the ironic authentication directory does not exist. The function should return NoAuth as the authentication type without any errors.
Valid Authentication Credentials:
Test Case: ValidAuth
Description: Tests the scenario where the ironic directory exists with valid username and password files. The function should return HTTPBasicAuth with the correct username and password.
Empty Username File:
Test Case: EmptyUsername
Description: Tests the scenario where the username file is present but empty. The function should return an error indicating that the HTTP Basic Auth username is empty.
Empty Password File:
Test Case: EmptyPassword
Description: Tests the scenario where the password file is present but empty. The function should return an error indicating that the HTTP Basic Auth password is empty.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues will close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
/remove-lifecycle stale
@lentzi90 this is still open, can we close this ? If not I would like to move this to the general roadmap.
Yes let's keep it open until we finish the last few points on the list