Code Coverage Report (with JaCoCo) in Azure DevOps Pipeline

Image Taken from

Changes in build.gradle

build.gradle file
  • jacoco/test.exec file
  • reports/jacoco/test/jacocoTestReport.xml file
  • reports/jacoco/test/html folder

Configuring JaCoCo Code Coverage in Azure DevOps

  • Open your Azure DevOps pipeline, click Edit Pipeline (If u already have one or create a new pipeline)
  • In your Gradle task, enable the checkmark “Publish to Azure Pipelines” under JUnit Test Results
  • Add a new task “Publish code coverage results” by clicking + button
  • Under Publish code coverage result task, choose the Code Coverage Tool as JaCoCo
  • Summary file Location${System.DefaultWorkingDirectory}/**/reports/jacoco/test/jacocoTestReport.xml
  • Report Directory${System.DefaultWorkingDirectory}/**/reports/jacoco/test/html
  • Save & Queue your pipeline



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store