external-dns
external-dns copied to clipboard
external-dns improve code coverage
What would you like to be added:
Current code coverage is ~76%, it would be beneficial to bump coverage to 90% or higher, this will simplify refactoring of certain features.
To find out lines that currently not covered with unit tests, run this command
make cover-html
Why is this needed:
- quality of the product
What you expected to happen:
- given the size of the codebase, slice/split work into multiple pull requests
- cover if/else where possible
- cover error cases like
if err !=nilas in majority of scenarios we only testing happy path - cover logs with method (optional as not everyone knows how to validate logs and there are some bugs currently in our framework) https://github.com/kubernetes-sigs/external-dns/blob/4b2fd495d944f9a67cdeb5260db95c5f2367d8bf/internal/testutils/log.go#L36
- github action to fail the build if code coverage is not X% (implemented last)
What is out of scope:
- Modifications of actual non-test logic (separate pull-request required for that)
Relevant PRs
- https://github.com/kubernetes-sigs/external-dns/pull/5337
- https://github.com/kubernetes-sigs/external-dns/commit/3c93bcb0768966fa97ce8b120495531eb7f6aa79
- https://github.com/kubernetes-sigs/external-dns/pull/5248
/help
@ivankatliarchuk: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/help
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-sigs/prow repository.
/good-first-issue
@ivankatliarchuk: This request has been marked as suitable for new contributors.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
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:
/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-sigs/prow repository.
/kind cleanup
/assign
/unassign
/assign
Hi @hjoshi123 this issue seems like is already have assignee. But there are way too many areas not covered with unit-tests. Worth to have a look, maybe there are easy wins. We should target 90%+ coverage in each file, error cases important to us as well.
Hi @ivankatliarchuk i want to contribute in this issue, i am exploring the codebase and trying to understand the testing implementation.
/open
/reopen /lifecycle frozen
@ivankatliarchuk: Reopened this issue.
In response to this:
/reopen /lifecycle frozen
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-sigs/prow repository.
@ivankatliarchuk @mloiseleur is it issue still open, i am sorry i wasn't active here