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

ci: add Codecov to check test coverage #611

Merged
merged 1 commit into from
Nov 16, 2023
Merged

ci: add Codecov to check test coverage #611

merged 1 commit into from
Nov 16, 2023

Conversation

phm07
Copy link
Contributor

@phm07 phm07 commented Nov 14, 2023

No description provided.

@phm07 phm07 self-assigned this Nov 14, 2023
@phm07 phm07 force-pushed the codecov-setup branch 3 times, most recently from b3a45aa to 879168a Compare November 14, 2023 10:15
Copy link

codecov bot commented Nov 14, 2023

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 ☂️

@phm07 phm07 marked this pull request as ready for review November 14, 2023 10:43
@phm07 phm07 requested a review from a team as a code owner November 14, 2023 10:43
Copy link
Member

@apricote apricote left a comment

Choose a reason for hiding this comment

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

Could we add this to our existing test runs?

run: go test -v -race ./...

@jooola jooola self-requested a review November 14, 2023 11:19
@phm07 phm07 requested a review from apricote November 14, 2023 11:23
@jooola
Copy link
Member

jooola commented Nov 14, 2023

If I remember correctly, codecov will fail the pipelines if the coverage status checks fail, e.g. coverage is less than 80%.

Maybe we want to wait a bit before we enable such check to make such we actually have the required coverage.

See:
https://docs.codecov.com/docs/commit-status#project-status
https://docs.codecov.com/docs/commit-status#patch-status

Also, we might need to enable the carryforward flags, but I am not sure if we have split tests in the CLI (unit/e2e) ?

https://docs.codecov.com/docs/carryforward-flags

Maybe we can start with codecov.yml:

---
coverage:
  status:
    project: off # Or on is we have enough covrage ?
    patch: off

@apricote
Copy link
Member

As far as I understood Codecov, Carryforward Flags are for setups where you only run a subset of tests (eg. only for changed files). We always run all tests. For different test suites you would use "flags": https://github.com/apricote/Listory/blob/25b738a246d380f1c526eb1de01cd146b0b3237f/.github/workflows/ci.yaml#L27

RE Status Checks, I would also prefer not to enable them. But I think we can do this organization wide at https://app.codecov.io/account/gh/hetznercloud/yaml/ instead of copying this in every repo.

@phm07 phm07 merged commit 44627e6 into main Nov 16, 2023
5 checks passed
@phm07 phm07 deleted the codecov-setup branch November 16, 2023 14:34
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.

3 participants