Code Coverage Report using JaCoCo Gradle plugin | Jacoco for Gradle Project | Access Jacoco Report

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hello friends in this session we are going to learn how to create Gradle project using command line so here prerequisites are installed Java and install Gradle so let's check I have already installed Java and Gradle if you don't install in your system Java and gradient firstly install these and after that you have to create Gradle project okay so let me open this command prompt [Music] um this theme Here and let's check here Java version is installed or not using Java space iPhone version enter and here Java version is already installed here this version is 15.0.1 and let's check Gradle is install or not using Gradle space hyphen version so let's wait some time MCR Gradle 7.6 this version I have already installed and let's create Gradle project using command line so step one we have to create Mac directory where we have to create a project so I want to create in that path okay so desktop devoxin and Gradle project so I have to already create a directory I have to insert in that directory okay so using CD desktop CD devops and and go inside the CD Gradle project okay so here I have Auto install or initialize Gradle project so second step is to initialize new Gradle project in empty folder using Gradle init command so here we use bridle in it for that new initialize new project for the Gradle so enter after that enter this process is going on and select type of the project to generate I want to generate application for that and here application number is to send then press 2 and enter and and I use the Java language for the implementation language here number is 3 and press 3 and enter after that split functionality across the multiples of project so no because I want to only one application project if you want to multiple application and Library projects then as okay so I will use no if directly I enter this then by default no option is automatically select here only one application so I want to I will directly Place editor and select build script DSL so here groovy we are using by default group is Select after they face directly enter Then generate build using new apis and behavior so by default no I press the no okay you can enter the directly enter or press the no after the end okay so select test framework I want to use junit framework so I use here first number and by default junit Jupiter but I want to use junit 4 okay so then press one okay then enter and after that we have to given a project name here by default Gradle project yeah I want to give here there Ops and Gradle okay the offset [Music] then after that Source package here devops in dot Gradle then this default by default I use here then or we use their Ops in okay space here and build successfully here very successfully here sorry for that then here see here project is initialized here Gradle project is initialed in that this path okay so let's wait something here I open this project or this folder in Visual Studio code then go to file and open folder and desktop drops in brittle project and this folder we will select here okay then like that this dot Gradle in that file system probe in the app here Gradle dot build here we are at the plugins repository and dependencies where I add here and also add tasks here and here Main and in the app SRC Main and test we can add here program and check here this is a by default program is generated in the SRC main Java okay so simply it's a hello world and in the SRC test Java they say that using this test we can generate output in our this applications okay so here Gradle wrapper here and here jar files and its properties are present here and get attribute and get ignore Gradle W and here it's a batch file window batch file and here these are the settings we are here use root project dot name and include app okay so see here in the Cradle project we are see step by step in these applications okay so like that it's a complete your adult version okay so like these these are the structure of a Gradle project so today's session we will learn how to create Gradle project using command line thank you for the watching video Hello friends in this session we are going to learn how to generate Joker report using Gradle so here prerequisites are installed Java language and install Gradle project in your system and create Gradle project okay so I have already installed Java and Gradle on my system and this Gradle project I I have already created here if you don't have install and create the Java project then install it first and after that go to next steps okay so next step is ADD Joker plugin in build.gradle so let's go here I have open the folder of the Gradle okay so in that Gradle Here app folder is present here in that app here build dot Gradle so here we have to add the plugins of the Joker so let me open this document and this plugins are here and these these repository dependencies and plugins are Auto generated I will copy this plugins and paste in Gradle build dot Gradle okay so here we are paste here and save it after that we add the Assassin Java program and SRC test Java program so let's copy this Java program copy and paste it SRC main Java devopsy app okay so we are copy here and sorry we are past here so paste so after that we will save it and next one program application SRC s Java the object okay so from here we will copy this program up here and paste in test Java de option app test so first year program and save it so here he this is the simply this is the simply palindrome program okay this is simply palindrop program and here see we apply the plugins for the Java and Jacob for the compilation we add the source compatibility and Target and for the test we add the finalized by Jacob test report and foreign save it all the dependencies are or plugins and this app test program and Java test program after that we use this terminal for the build program okay so use here and using the yeah using the Gradle W clean build command we will build project okay so use Gradle W clip build and enter and see in the folder in that app here build folder is generate automatically okay and that's where folder we will see build successful so in Net bill C Z HTML folder present here in that HTML folder this index.html okay this index.html we will open with sorry not from here we will go to yes application build system Jacob HTML and index on that index we will right click and open with Firefox or Google you can use any browser here let's sweat body open this okay now it's open and it's the option and missed instruction 0 out of 44 and core is hundred percent Miss Branch is 0 out of six its coverage hundred percent is 0 out of six Miss line 0 out of ten Miss methods are 0 out of three and plus a when we will go inside this app then we will see details of the project okay how much how much lines how much methods and how much control statement each and everything it's completely covered code coverage or not okay so here in green color Diamond it's completely hundred percent coverage if we want to see partially coverage or some percentage of the coverage then we will comment in the app test for that particular method okay so I will comment here and firstly we have to use Gradle W clean command and clean the this belt clinic and after that we will use clean Gradle W clean build command and other again build this program okay so again here belt application build folder is created clear build successfully and go to folder build HTML index right click on that open with Starbucks sorry for that because we have here we we are not save this program that's why this is not generated so again we clean and build and now it it will generate up right or it will generate correctly okay after it builds successful now it's built successful and let's see in the HTML code go inside right click on index open with Firefox and see now it's logo coverage it's correct and see the application so here it's yellow color Diamond means it's a partially covered our code and it's red color it's red color it's not cover the cool and it's green color it's covered decode means in our application we will see coverage are 84 percent and misinstruction 7 out of 44 and Miss branches 2 fear nice branches to check this one bra and with this one branch is missier these two branches are miserable okay so miss context is two out of six mislines are two out of ten okay and Miss methods are zeros then C okay like this we will check it coverage so here or we can access using the HTML index okay and see a red diamond yellow diamond and grinder then we will learn how to generate Joker report using Gradle so thank you for the watching video
Info
Channel: DevOps Hint
Views: 3,860
Rating: undefined out of 5
Keywords: Code Coverage Report using JaCoCo Gradle plugin, Jacoco for Gradle Project, Access Jacoco Report for Gradle Project, Create Gradle Project using command line, Using JaCoCo to measure system test coverage
Id: OGFjDL0_7-g
Channel Id: undefined
Length: 19min 17sec (1157 seconds)
Published: Sun Mar 05 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.