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

add test coverage workflow #847

Merged
merged 4 commits into from
Jan 18, 2024
Merged

Conversation

danieleades
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@Philippe-Cholet
Copy link
Member

After reading the readme, I learnt that nightly is required to support doctests (and without it, coverage would probably be quite lacking for non-adaptor Itertools methods, as I found out when experimenting with tarpaulin a while back).
Looks good otherwise.

@danieleades
Copy link
Contributor Author

After reading the readme, I learnt that nightly is required to support doctests (and without it, coverage would probably be quite lacking for non-adaptor Itertools methods, as I found out when experimenting with tarpaulin a while back). Looks good otherwise.

i'm not sure what you mean? Nightly is required for the doctests coverage, which is why that's the toolchain used in the github action. Is that an issue?

@Philippe-Cholet
Copy link
Member

Not an issue but an observation that I found useful to share, that's all.
Looks good otherwise.

Copy link
Member

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

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

Shouldn't the triggers for this be basically identical to our triggers for CI testing?

on:
pull_request:
paths-ignore:
- "**.md"
merge_group:
paths-ignore:
- "**.md"

@danieleades
Copy link
Contributor Author

danieleades commented Jan 15, 2024

Shouldn't the triggers for this be basically identical to our triggers for CI testing?

on:
pull_request:
paths-ignore:
- "**.md"
merge_group:
paths-ignore:
- "**.md"

sure, i can update with this. it will also need to run on master though, so would be something like (i guess)-

 on: 
   pull_request: 
     paths-ignore: 
       - "**.md" 
  push: 
    branches: [ master ]
     paths-ignore: 
       - "**.md" 
   merge_group: 
     paths-ignore: 
       - "**.md" 

that look right?

@Philippe-Cholet
Copy link
Member

We currently only "push changes to master" by adding PRs to the merge queue (merge_group trigger) so I think your on: push: branches: [master] is quite similar to on: merge_queue:, right? (Or am I missing something? github workflow noob here). So it could just be the same as in CI:

on:
pull_request:
paths-ignore:
- "**.md"
merge_group:
paths-ignore:
- "**.md"

Maybe the difference is that on: push: branches: [master] happens "when merged" while on: merge_queue: is "while being merged"? I'm not sure to care about this difference.

@danieleades
Copy link
Contributor Author

I'm not at all familiar with the intersection of merge queues and GitHub actions.

For codecov to do its thing it needs to run on PRs and also needs to have run on the most recent commit on master at any one time (for comparison). So long as any squashing/merging is done before the merge queue does its thing I guess you don't also need to run on push? The main thing is that the commit hash is identical to the tip of master

@danieleades
Copy link
Contributor Author

i've updated based on the discussion in this issue - matplotlib/napari-matplotlib#155

@Philippe-Cholet
Copy link
Member

Since merge_group is not a trigger anymore (not in on: block), I am not sure if: github.event_name != 'merge_group' is useful but it sure is not a problem to have it.
Seems good to me.

@danieleades
Copy link
Contributor Author

Since merge_group is not a trigger anymore (not in on: block), I am not sure if: github.event_name != 'merge_group' is useful but it sure is not a problem to have it. Seems good to me.

i'll happily remove it if it's redundant. I don't know have any experience with github merge queues

Copy link
Member

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

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

LGTM! If, for some reason, this isn't quite the right combination of triggers, we can revise in a follow-up PR.

Thank you so much for this!

@jswrenn jswrenn added this pull request to the merge queue Jan 18, 2024
Merged via the queue into rust-itertools:master with commit f4afe79 Jan 18, 2024
10 checks passed
@Philippe-Cholet
Copy link
Member

#835 (comment) says "Missing Base Commit". Maybe that merge this did not trigger an initial coverage report?

@danieleades
Copy link
Contributor Author

danieleades commented Jan 18, 2024

#835 (comment) says "Missing Base Commit". Maybe that merge this did not trigger an initial coverage report?

looks like this coverage job ran on master but failed to upload - https://github.com/rust-itertools/itertools/actions/runs/7573294610/job/20625097590

edit: looks like a rate-limiting issue from the github API. adding an upload token is described as a workaround.
specifically:

  • upload tokens are required for private repos
  • upload tokens are not required for public repos, since the public api is used
  • the public API is rate-limited which occasionally causes the job to fail
  • adding the codecov token to the action in a public repo obviates the problem

@Philippe-Cholet
Copy link
Member

I searched a bit and found the same thing: codecov/codecov-action#557 (comment)

@Philippe-Cholet Philippe-Cholet added this to the next milestone Jan 18, 2024
@danieleades
Copy link
Contributor Author

danieleades commented Jan 19, 2024

the codecov token secret will need to be set up by a maintainer
alternatively, a maintainer could trigger the workflow again on master

@Philippe-Cholet
Copy link
Member

For the secret, I'm pretty sure an owner would be required, which means jswrenn (or bluss).
As a temporary fix, I triggered the workflow and got success: https://app.codecov.io/github/rust-itertools/itertools/tree/master/src

@danieleades danieleades deleted the coverage branch January 19, 2024 08:38
@Philippe-Cholet
Copy link
Member

Philippe-Cholet commented Jan 19, 2024

We don't test Debug/Display/Clone implementations (and helper macros). Apart from this, it's pretty good:

  • EitherOrBoth miss quite some doctests if we were diligent enough about all the methods.
  • Combinations::reset has some unused code (because Powerset only uses increasing ks).
  • MultiProduct::count would be tested with Rewrite MultiProduct #835.
  • Very few size_hint/next_back untested. Specialization tests are not full yet.
  • A few edge cases here and there.

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.

4 participants