Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Add codecoverage for the Kafka plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Carino <carino_jade@yahoo.co.uk>
  • Loading branch information
jadecarino committed Jun 16, 2024
1 parent 286eb1a commit eb01bc3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,19 @@ function displayCouchDbCodeCoverage {
info "See html report here: file://${BASEDIR}/galasa-extensions-parent/dev.galasa.ras.couchdb/build/jacocoHtml/index.html"
}

function displayKafkaCodeCoverage {
h2 "Calculating Kafka code coverage..."
percent_code_complete=$(cat ${BASEDIR}/galasa-extensions-parent/dev.galasa.events.kafka/build/jacocoHtml/dev.galasa.events.kafka.internal/index.html \
| sed "s/.*<td>Total<\/td>//1" \
| cut -f1 -d'%' \
| sed "s/.*>//g")
info
info
info "Statement code coverage is ${percent_code_complete}%"
info
info "See html report here: file://${BASEDIR}/galasa-extensions-parent/dev.galasa.events.kafka/build/jacocoHtml/index.html"
}

function check_secrets {
h2 "updating secrets baseline"
cd ${BASEDIR}
Expand Down Expand Up @@ -235,6 +248,7 @@ function check_secrets {
clean_maven_repo
build_with_gradle
displayCouchDbCodeCoverage
displayKafkaCodeCoverage
check_secrets

success "Project ${project} built - OK - log is at ${log_file}"
9 changes: 9 additions & 0 deletions galasa-extensions-parent/dev.galasa.events.kafka/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'biz.aQute.bnd.builder'
id 'galasa.extensions'
id 'jacoco'
}

description = 'Galasa Events Plug-In - Kafka'
Expand All @@ -13,3 +14,11 @@ dependencies {

testImplementation(project(':dev.galasa.extensions.mocks'))
}

jacocoTestReport {
reports {
xml.required = true
csv.required = true
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}

0 comments on commit eb01bc3

Please sign in to comment.