apache / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
19.74k stars 6.69k forks source link

Add code coverage in codecov #26526

Open taojintianxia opened 1 year ago

taojintianxia commented 1 year ago

as we could see on https://app.codecov.io/gh/apache/shardingsphere there have been no code coverage updates in the last three months, please add the code coverage in codecov.io.

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

Zhenye-Na commented 11 months ago

I am assuming update the coverage need an access to the project in codecov and it could not be accessed without being part of the organization (apache) or contributor to this repo ?

If we dont need extra access for this, maybe I can pick this up since it sounds pretty straightforward to me.

Zhenye-Na commented 11 months ago

Hi @taojintianxia , I know you are busy, so I make another comment here to increase visibility.

Please feel free to let me know if I could pick up this task and if I need extra permission to update the coverage icon.

Thank you!

Zhenye-Na commented 11 months ago

Further investgation pointed out that if any maintainer of this repo could access repo settings > secrets and variable > actions and properly set the variable of CODECOV_TOKEN=EXAMPLE

I could make the following steps in the nightly-check.yml or other CI you proposed to enable this feature

- name: Upload coverage reports to Codecov
  uses: codecov/codecov-action@v3
  env:
    CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
taojintianxia commented 10 months ago

Further investgation pointed out that if any maintainer of this repo could access repo settings > secrets and variable > actions and properly set the variable of CODECOV_TOKEN=EXAMPLE

I could make the following steps in the nightly-check.yml or other CI you proposed to enable this feature

- name: Upload coverage reports to Codecov
  uses: codecov/codecov-action@v3
  env:
    CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

there is no settings for the Apache project since all the settings are maintained by apache infra team. we have to raise up an Apache Ticket to apache infra team.

and as I can see, it will not take an effect if only add the upload codecov action, let me explain this to you : Codecov is a webiste to show the code coverage for a repository, but codecov itself will not execute any test and generate the code coverage, it just read the test report from a repository. the most popular report is jacoco report, whenever we launch up a test task, generate the jacoco report and then upload that report to codecov, after that , codecov read and parse then show the code coverage on it's website.this is the correct process.

however after we upgrade the test to Junit 5, it will not generate jacoco report correctly, that's the reason codecov disply nothing.

and, BTW, I read the document for codecov action several month ago, I remember the public repositoy does not need the token

image
taojintianxia commented 10 months ago

@Zhenye-Na I have a suggestion, you could fork the shardingsphere project and test the action for you own fork, cause in your fork repository, you have the permission to modify settings. ^_^

Zhenye-Na commented 10 months ago

I see. Thanks for the explanation, I always forget that I have my own fork which could be used to test things out.

Let me get back to you and publish a PR if I find the way to solve this

github-actions[bot] commented 9 months ago

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.