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

Code coverage #656

Merged
merged 8 commits into from
Jul 2, 2024
Merged

Conversation

kevindlewis23
Copy link
Collaborator

@kevindlewis23 kevindlewis23 commented Jun 27, 2024

Codecov needs to be setup. Get a token from here and setup for hexrd. Must be added as a workflow secret in settings.

Once it is, this PR adds a code coverage workflow and a status badge to the readme.

Maybe refactor to add the code coverage workflow to be part of the test workflow. I did it separately because the test workflow runs on many OS's and that is unnecessary for coverage checks. Also codecov needs an editable install of hexrd, and while I assume that doesn't change anything, the actual test cases should be as close to production as possible.

Fixes: #571

Copy link
Collaborator

@psavery psavery left a comment

Choose a reason for hiding this comment

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

What we have done on other projects is to include the codecov logic within the tests workflow, but only run it on one operating system (for instance, Linux). For example, for the Upload coverage to Codecov action, you can say if: ${{ matrix.config.name == 'Linux'}}, and there are things you can do to add the extra codecov arguments as well for only Linux (and not the other operating systems).

However, I'm not sure what to do about the editable install (-e) part. I guess we can keep this as a separate workflow if we want the main tests to not perform an editable install. The only issue is that, if we make workflow changes to the test.yml, they won't be reflected here. But we might need to just work with that anyways. What do you think?

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This token has been added.

@kevindlewis23
Copy link
Collaborator Author

However, I'm not sure what to do about the editable install (-e) part. I guess we can keep this as a separate workflow if we want the main tests to not perform an editable install. The only issue is that, if we make workflow changes to the test.yml, they won't be reflected here. But we might need to just work with that anyways. What do you think?

I think it makes more sense to move it actually. I'm going to do that

@kevindlewis23
Copy link
Collaborator Author

I added the codecov stuff to the test workflow now

Copy link
Collaborator

@psavery psavery left a comment

Choose a reason for hiding this comment

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

Looks good to me

@kevindlewis23 kevindlewis23 merged commit d82d59f into HEXRD:master Jul 2, 2024
3 of 6 checks passed
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.

Adding Coveralls or similar to auto-check new PR for unit tests
2 participants