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

tests: upgraded tarpaulin and added derive macro coverage #1466

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

tyrone-wu
Copy link
Contributor

Upgraded tarpaulin to new the new maintainer, added coverage for derive macro, and added an example.

Motivation

Resolves #1144

Solution

Here's the codecov for this PR. https://app.codecov.io/gh/tyrone-wu/kube/tree/tests%2Fupdate-code-coverage

  • Bump to latest (currently 0.27.3) from our pin at 0.18.5 from Nov 2021
    • Upgraded tarpaulin to the new maintainer.
  • Find a better GH Action approach (see below for the issues with actions-rs/tarpaulin) - taike-e install
    • For now, this uses the tarpaulin dev version from https://github.com/xd009642/tarpaulin since the false negative coverage isn't in release yet (not sure when it'll be in). Once it's in release, it can be switched back to taike-e install.
  • Try the proc macro coverage so that we can get credit for tests in kube-derive (currently it looks bad but it is tested)
  • Do an all-features build in coverage (to ensure numbers are the most accurate and the most tests run)
  • Try to include one or two examples if it can be done quickly (better to improve coverage with actual integration tests)
    • Tarpaulin now includes the crd_derive_schema example, and default feature is now the default of running it (I think).

I noticed the codecov step uses v3. Would you prefer also upgrading it to latest v4? I'm not sure what things this adds or changes so it might not be necessary.

@clux clux self-assigned this Apr 11, 2024
Upgraded tarpaulin to new the new maintainer, added coverage for derive
macro, and added an example.

Fixes: kube-rs#1144

Signed-off-by: tyrone-wu <[email protected]>
@tyrone-wu tyrone-wu force-pushed the tests/update-code-coverage branch from 3ed5874 to 7444aae Compare April 11, 2024 21:41
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

Thank you so much for this. This looks great on paper. Minor nit on git pins, and CI doesn't like it atm but I guess that is token perms.

[2024-04-11T21:53:06.477Z] ['error'] There was an error running the uploader: Error uploading to [https://codecov.io:](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}

Will run a quick local verify tomorrow. EDIT: ran it, works great.

codecov step uses v3

yeah, dw about that. I'll get in dependabot to update actions for us afterwards.

.github/workflows/coverage.yml Outdated Show resolved Hide resolved
.github/workflows/coverage.yml Show resolved Hide resolved
kube-derive/Cargo.toml Outdated Show resolved Hide resolved
kube-derive/src/custom_resource.rs Show resolved Hide resolved
@tyrone-wu tyrone-wu marked this pull request as ready for review April 12, 2024 18:22
@clux clux added this to the 0.91.0 milestone Apr 12, 2024
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

Thank you so much!

@clux clux added the changelog-exclude changelog excluded prs label Apr 12, 2024
@clux clux merged commit 5e379ff into kube-rs:main Apr 12, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-exclude changelog excluded prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade tarpaulin for new features
2 participants