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

pytest coverage badge! #127

Merged
merged 2 commits into from
Aug 19, 2024
Merged

pytest coverage badge! #127

merged 2 commits into from
Aug 19, 2024

Conversation

ryansurf
Copy link
Owner

@ryansurf ryansurf commented Aug 18, 2024

General:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code:

  1. Does your submission pass tests?
  2. Have you run the linter/formatter on your code locally before submission?
  3. Have you updated the documentation/README to reflect your changes, as applicable?
  4. Have you added an explanation of what your changes do?
  5. Have you written new tests for your changes, as applicable?

Summary by Sourcery

Integrate Codecov into the CI workflow to track test coverage and update the README with a Codecov badge.

New Features:

  • Add Codecov integration to the CI workflow to upload test coverage results.

Enhancements:

  • Update the CI workflow to run tests and collect coverage using pytest with a coverage report in XML format.

CI:

  • Modify the GitHub Actions workflow to include a step for uploading coverage results to Codecov.

Documentation:

  • Add a Codecov badge to the README to display the current test coverage status.

Copy link
Contributor

sourcery-ai bot commented Aug 18, 2024

Reviewer's Guide by Sourcery

This pull request integrates Codecov into the CI workflow to report test coverage and adds a Codecov badge to the README. The main changes involve modifying the GitHub Actions workflow file to include Codecov for test coverage reporting and updating the README to display the coverage status.

File-Level Changes

Files Changes
.github/workflows/pytest.yml Refactored the CI workflow to improve clarity and organization of steps
.github/workflows/pytest.yml Updated the test running step to use pytest with coverage reporting in XML format
.github/workflows/pytest.yml Added a step to upload test coverage results to Codecov
.github/workflows/pytest.yml Commented out the previous pytest coverage comment step
README.md Added a Codecov badge to display test coverage status

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @ryansurf - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Hard-coded Codecov token found in README. (link)
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🔴 Security: 1 blocking issue
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -1,5 +1,6 @@
![pytest](https://github.com/ryansurf/cli-surf/actions/workflows/pytest.yml/badge.svg)
![linter](https://github.com/ryansurf/cli-surf/actions/workflows/linter.yml/badge.svg)
[![codecov](https://codecov.io/github/ryansurf/cli-surf/graph/badge.svg?token=N8CAIUXMJG)](https://codecov.io/github/ryansurf/cli-surf)
Copy link
Contributor

Choose a reason for hiding this comment

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

🚨 issue (security): Hard-coded Codecov token found in README.

It's important to avoid exposing tokens in public files like README.md. Consider using environment variables or GitHub secrets to manage sensitive information.

@ryansurf ryansurf marked this pull request as draft August 18, 2024 01:38
Repository owner deleted a comment from github-actions bot Aug 19, 2024
@ryansurf ryansurf marked this pull request as ready for review August 19, 2024 19:26
Copy link

codecov bot commented Aug 19, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

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

@ryansurf ryansurf merged commit 75d23ed into main Aug 19, 2024
10 checks passed
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @ryansurf - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Hard-coded Codecov token found in README. (link)
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🔴 Security: 1 blocking issue
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

poetry config installer.max-workers 10
poetry install --no-interaction --no-ansi

# - name: Run tests
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Remove commented-out code

Consider removing the commented-out sections if they are no longer needed. This will improve the readability and maintainability of the workflow file.

@@ -1,5 +1,6 @@
![pytest](https://github.com/ryansurf/cli-surf/actions/workflows/pytest.yml/badge.svg)
![linter](https://github.com/ryansurf/cli-surf/actions/workflows/linter.yml/badge.svg)
[![codecov](https://codecov.io/github/ryansurf/cli-surf/graph/badge.svg?token=N8CAIUXMJG)](https://codecov.io/github/ryansurf/cli-surf)
Copy link
Contributor

Choose a reason for hiding this comment

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

🚨 issue (security): Hard-coded Codecov token found in README.

It's important to avoid exposing tokens in public files like README.md. Consider using environment variables or GitHub secrets to manage sensitive information.

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.

1 participant