Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No test checking if result message is for create_pull_request #140

Open
tohanss opened this issue Jul 23, 2021 · 1 comment
Open

No test checking if result message is for create_pull_request #140

tohanss opened this issue Jul 23, 2021 · 1 comment

Comments

@tohanss
Copy link
Contributor

tohanss commented Jul 23, 2021

In the function _sanitize_to_target_branch there is a return statement as follow

return "Successfully sanitized repo" + (
    f" to pull request branch\n\nrun 'git switch "
    f"{effective_target_branch}' to checkout the branch"
    if self.create_pr_branch else ""
)

I had accidentaly removed the if statement and the tests still passed, meaning there is no check for if the text contains "pull request" and so on when we run with the create_pr_branch flag.

If codecov doesnt complain this is probably not worth testing

@slarse
Copy link
Contributor

slarse commented Jul 24, 2021

If codecov doesnt complain this is probably not worth testing

Codecov says nothing about test quality. It only tells you if a test traverses a given branch or statement. You can have 100% coverage and 0 assertions. I.e. you can have 100% coverage yet no meaningful tests.

In short: code coverage can only ever tell you what you're definitely not testing. It can't tell you if you're testing something in a meaningful way. Never rely on it for the latter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants