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

Integrate code coverage into Travis pipeline and GitHub PR workflow #8246

Open
fearphage opened this issue Sep 11, 2021 · 4 comments
Open

Integrate code coverage into Travis pipeline and GitHub PR workflow #8246

fearphage opened this issue Sep 11, 2021 · 4 comments
Labels
Developers Discussion Discussion about redesign or changes enhancement

Comments

@fearphage
Copy link
Contributor

This is a follow-up to #6875. Related to d481172.

Now that coverage exists, we need to upload the results to a service that will track the coverage over time and that integrates with GitHub to share the progress in the pull requests.

The 2 I most commonly come across are:

Both have integrations and examples showing how to integrate into your current Travis workflow. Here are links to the related maven plugins:

I believe the first step is to setup an account with one of the selected services. I can do the work of adding the plugins and such, but an admin would need to setup the project in Coveralls or CodeCov and supply any API keys or related artifacts.

@JayDi85
Copy link
Member

JayDi85 commented Sep 11, 2021

As I stated in d481172 -- coverage report can't be enabled in CI process due project size. It takes almost 1 hour on good computer to generate and upload full report to the sonar (on 2023 it takes 10+ hours on default report).

Example: my computer runs tests 2-3 minutes compared to 10 minutes on current travis's CI (coverage + sonar takes 30-60 mins) -- so full coverage report must takes few hours in CI.

Maybe there are possible other way, don't known.

Sonar cloud's track coverage report:
https://sonarcloud.io/dashboard?id=JayDi85_mage

shot_210911_133013

@JayDi85
Copy link
Member

JayDi85 commented Sep 11, 2021

You can test integration with local or forked repository. If it works fine then it will be added to current.

@JayDi85
Copy link
Member

JayDi85 commented May 10, 2023

Actual static code analysis report by sonarcloud available from that url: https://sonarcloud.io/project/overview?id=magefree_mage or from badges in readme/main github's page.

It also contains a code coverage report by jacoco. I'll updates it manually time by time (once per week/month/etc).

Sonarcloud takes 6+ hours to process whole project on good PC, so it can't be integrated on cloud hosting CI like travis or github actions.

@JayDi85
Copy link
Member

JayDi85 commented May 10, 2023

Current workflow for manual build and analysis (run by maven):

  1. Clean and build project:
mvn clean install -DskipTests
  1. Run tests with code coverage report:
mvn install -Djacoco.skip=false -Dmaven.test.failure.ignore=true
  1. Run sonarcloud analysis (replace org, project and token by your own):
mvn -e sonar:sonar -Dsonar.projectKey=magefree_mage -Dsonar.organization=magefree -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=SONAR_ACCESS_HERE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developers Discussion Discussion about redesign or changes enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants