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

100% test coverage #1074

Merged
merged 1 commit into from
Sep 8, 2024
Merged

100% test coverage #1074

merged 1 commit into from
Sep 8, 2024

Conversation

anderseknert
Copy link
Member

Like with previous PR aiming to increase our test coverage (#1058), doing so this time revealed a few places where code was unused, or could be rewritten to be better optimized, removed, or made easier to read.

One find that is yet to be addressed here is how we copy the whole ast.found.refs object into ast.all_refs, which surely comes with a cost that seems unnecessary, given we can use ast.found.refs directly instead. But since there are a few consumers, and they are not exactly identical (all_refs contains import refs too), I'll follow up on that in a later PR.

I'm also adding the codecov badge to the README to make it easy to see when our coverage drops. But I'm not as convinced we should fail PRs when coverage isn't 100% as I was before, as it might make for a worse contributor experience.

Fixes #918

Like with previous PR aiming to increase our test coverage (#1058),
doing so this time revealed a few places where code was unused, or
could be rewritten to be better optimized, removed, or made easier
to read.

One find that is yet to be addressed here is how we copy the whole
`ast.found.refs` object into `ast.all_refs`, which surely comes with
a cost that seems unnecessary, given we can use `ast.found.refs`
directly instead. But since there are a few consumers, and they are
not **exactly** identical (`all_refs` contains import refs too),
I'll follow up on that in a later PR.

I'm also adding the codecov badge to the README to make it easy to
see when our coverage drops. But I'm not as convinced we should
fail PRs when coverage isn't 100% as I was before, as it might make
for a worse contributor experience.

Fixes #918

Signed-off-by: Anders Eknert <anders@styra.com>
Copy link
Member

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100% lgtm

@anderseknert anderseknert merged commit 2690748 into main Sep 8, 2024
4 checks passed
@anderseknert anderseknert deleted the more-coverage branch September 8, 2024 08:46
srenatus pushed a commit to srenatus/regal that referenced this pull request Oct 1, 2024
Like with previous PR aiming to increase our test coverage (StyraInc#1058),
doing so this time revealed a few places where code was unused, or
could be rewritten to be better optimized, removed, or made easier
to read.

One find that is yet to be addressed here is how we copy the whole
`ast.found.refs` object into `ast.all_refs`, which surely comes with
a cost that seems unnecessary, given we can use `ast.found.refs`
directly instead. But since there are a few consumers, and they are
not **exactly** identical (`all_refs` contains import refs too),
I'll follow up on that in a later PR.

I'm also adding the codecov badge to the README to make it easy to
see when our coverage drops. But I'm not as convinced we should
fail PRs when coverage isn't 100% as I was before, as it might make
for a worse contributor experience.

Fixes StyraInc#918

Signed-off-by: Anders Eknert <anders@styra.com>
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

Successfully merging this pull request may close these issues.

100% test coverage
2 participants