-
Notifications
You must be signed in to change notification settings - Fork 4
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
chore: add code coverage #244
Conversation
WalkthroughThe pull request introduces enhancements to the project's build and testing infrastructure by modifying the Earthfile and README.md. The changes focus on improving test configuration flexibility, allowing conditional integration test execution and optional coverage reporting. A Codecov badge is also added to the README to provide visibility into code coverage metrics. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
1f30f2c
to
e877ba6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
Earthfile (5)
70-70
: Use descriptive default value forincludeIntegrationTests
.
Currently, the default value is"true"
, which may be confusing. Consider providing a descriptive comment or a more explicit rationale for this default to help future contributors.
72-72
: Document coverage argument usage for clarity.
While adding this argument enhances flexibility, it would be helpful to add a short comment describing valid values (e.g.,true
or empty) and their effects on the build/test process.
77-77
: Confirm the necessity of-race
for all test runs.
Enabling-race
on every test run can increase test runtime and resource usage. If race detection is not required for certain builds, consider making it conditional or providing an option to disable it.
78-84
: Combine coverage flags for legibility.
Combining multiple coverage flags into a single line can improve readability. For example, grouping-covermode
and-coverpkg
arguments into oneSET goFlags=...
statement.Here’s an example diff snippet to illustrate a refactor:
IF [ "$coverage" = "true" ] - SET goFlags="$goFlags -covermode=atomic" - SET goFlags="$goFlags -coverpkg=github.com/formancehq/payments/internal/..." - SET goFlags="$goFlags,github.com/formancehq/payments/pkg/events/..." - SET goFlags="$goFlags,github.com/formancehq/payments/cmd/..." - SET goFlags="$goFlags -coverprofile coverage.txt" + SET goFlags="$goFlags -covermode=atomic -coverpkg=github.com/formancehq/payments/internal/...,github.com/formancehq/payments/pkg/events/...,github.com/formancehq/payments/cmd/... -coverprofile coverage.txt" END
99-101
: Automate coverage upload to Codecov.
This step saves the coverage report locally. Consider adding an automated upload step to continuously track coverage changes via Codecov.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
.github/workflows/main.yml
is excluded by!**/*.yml
📒 Files selected for processing (2)
Earthfile
(2 hunks)README.md
(1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
README.md (1)
1-1
: Appreciate the new Codecov badge!
The Codecov badge integration complements the new coverage arguments in the Earthfile, enhancing visibility into test coverage. Everything looks good here.
No description provided.