Gototal-cobertura - A Go utility that reports the total code coverage from a cobertura XML code coverage report

gototal-cobertura

A Go utility that reports the total code coverage from a cobertura XML code coverage report.

Usage

This is useful in cases like the gitlab pipelines that take a regular expression and uses the last match found from the output to find the coverage. For go test --cover this becomes an issue if you have multiple packages as only the last packages coverage will be reported on.

This utility will read the generated cobertura report and output the total coverage. If this utility is run at the end of the gitlab job, then the regex can match on the total code coverage.

An example .gitlab-ci.yml job might look something like the following:

golang:
  stage: test
  script:
    - go install gotest.tools/gotestsum
    - go install github.com/boumenot/gocover-cobertura
    - go install github.com/ggere/gototal-cobertura
    - gotestsum --junitfile report.xml --format testname -- -coverprofile=coverage.out ./...
    - gocover-cobertura < coverage.out > coverage.xml
    - gototal-cobertura < coverage.xml
  artifacts:
    when: always
    reports:
      junit: report.xml
      cobertura: coverage.xml

Output

Total coverage: 62.50%

Installation

go install gitlab.com/ggere/gototal-cobertura@latest
Similar Resources

Total-go-shopify-graphql - A simple client using the Shopify GraphQL Admin API

A simple client using the Shopify GraphQL Admin API.

Jan 25, 2022

Count total LoC in a given folder, recursively.

GoLoc A simple CLI tool to calculate the total LoC of a given directory. Usage goloc Flags Flag Description --use-gitignore Use your .gitignore file a

Apr 27, 2022

octocov is a tool for collecting code metrics (code coverage, code to test ratio and test execution time).

octocov is a tool for collecting code metrics (code coverage, code to test ratio and test execution time).

Jan 9, 2023

A Golang tool that does static analysis, unit testing, code review and generate code quality report.

A Golang tool that does static analysis, unit testing, code review and generate code quality report.

goreporter A Golang tool that does static analysis, unit testing, code review and generate code quality report. This is a tool that concurrently runs

Jan 8, 2023

A Go package that reports processor topology

Description ------------ cpu package reports (some) processor topology information Note that the term package refers to a physical processor

Nov 5, 2022

A minimalist Go PDF writer in 1982 lines. Draws text, images and shapes. Helps understand the PDF format. Used in production for reports.

A minimalist Go PDF writer in 1982 lines. Draws text, images and shapes. Helps understand the PDF format. Used in production for reports.

one-file-pdf - A minimalist PDF generator in 2K lines and 1 file The main idea behind this project was: "How small can I make a PDF generator for it

Dec 11, 2022

Continuous performance analysis reports for software projects 🤖

Performabot Welcome to Performabot! This little helper can be used to provide Continuous Performance Reports within your GitHub project. But please be

Nov 16, 2022

Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊

askgit askgit is a command-line tool for running SQL queries on git repositories. It's meant for ad-hoc querying of git repositories on disk through a

Jan 5, 2023

ginko-volkswagen detects when your tests are being run in a CI server, and reports them as passing

detects when your ginkgo-based tests are being run in a CI server, and reports them as passing

Dec 4, 2021

Cloud governance reports from native services in a clear and readable digest

Cloud governance reports from native services in a clear and readable digest

cloudig, or Cloudigest, is a simple CLI tool for creating reports from various cloud sources with user-provided comments. It is written in Go and curr

Nov 10, 2022

A simple http service that generates *.PDF reports from Grafana dashboards.

A simple http service that generates *.PDF reports from Grafana dashboards.

Grafana reporter A simple http service that generates *.PDF reports from Grafana dashboards. Requirements Runtime requirements pdflatex installed and

Dec 27, 2022

Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊

Query git repositories with SQL. Generate reports, perform status checks, analyze codebases. 🔍 📊

askgit is a command-line tool for running SQL queries on git repositories. It's meant for ad-hoc querying of git repositories on disk through a common interface (SQL), as an alternative to patching together various shell commands.

Jan 3, 2023

Go linter that checks types that are json encoded - reports unsupported types and unnecessary error checks

Checks types passed to the json encoding functions. Reports unsupported types and reports occations, where the check for the returned error can be omited.

Oct 7, 2022

A tool to aggregate and mine data from JSON reports of Go tests.

teststat A tool to aggregate and mine data from JSON reports of Go tests. Why? Mature Go projects often have a lot of tests, and not all of them are i

Sep 15, 2022

Send Slack reports of pull requests pending review

Send Slack reports of pull requests pending review

preport Born out of a desire to get pull requests reviewed faster without having to send manual reminders, preport generates reports of GitLab pull re

Nov 23, 2021

A prometheus exporter which reports metrics about your Gmail inbox.

prometheus-gmail-exporter-go A prometheus exporter for gmail. Heavily inspired by https://github.com/jamesread/prometheus-gmail-exporter, but written

Nov 15, 2022

A standalone exporter for vulnerability reports and other CRs created by Starboard.

starboard-exporter Exposes Prometheus metrics from Starboard's VulnerabilityReport custom resources (CRs). Metrics This exporter exposes two types of

Dec 14, 2022

System agent. Reports server status via HTTP API

sys-agent System agent is a simple service reporting server status via HTTP GET request. usage $ sys-agent -l :8080 -v "root:/" -v "data:/mnt/data" Ap

Dec 20, 2022

Collects REST Api calls for log4j reports

log4j-collector This is a simple log4j collector that will collect logs from a H

Dec 20, 2021
Act as part of the business code and will report aqua scan report after application installed
Act as part of the business code and will report aqua scan report after application installed

starboard-report This repo aim to enrich the functionality of starboard. Starboard integrates security tools into the Kubernetes environment, so that

Nov 25, 2021
Keeps track of Steam Deck Verifications. On first run, it reports all games with their respective Steam Deck Verification status. On subsequent runs, the tool will report newly tested and updated games.

Keeps track of Steam Deck Verifications. On first run, it reports all games with their respective Steam Deck Verification status. On subsequent runs, the tool will report newly tested and updated games.

Feb 2, 2022
Bitrise step to parse a JaCoCo generated report and output the code coverage percentages to be used by other steps.

JaCoCo Report Parser This step parses a JaCoCo generated XML report in the jacoco_report_path and outputs the coverage percentages in a String format

Dec 6, 2021
The portal gates to coverage reports
The portal gates to coverage reports

Covergates - Portal Gates to Coverage Reports Purpose Covergates is to make the easiest way to setup a self-hosted coverage report service. It's an al

Dec 18, 2022
A tool to convert go test results to testng reports xml.

go-testng-report A tool to convert go test results to testng reports xml. Usage of testng-report: -json-report string Golang json test report (defa

Dec 8, 2021
Freaking simple AWS Reserved Instance and Usage coverage report
Freaking simple AWS Reserved Instance and Usage coverage report

richeck This tool allows you to simply see the EC2 and ElastiCache nodes you have reserved on amazon. Motivation: How many instances are currently res

Oct 17, 2021
Go encoding/xml package that improves support for XML namespaces

encoding/xml with namespaces This is a fork of the Go encoding/xml package that improves support for XML namespaces, kept in sync with golang/go#48641

Nov 11, 2022
Gosaxml is a streaming XML decoder and encoder, similar in interface to the encoding/xml

gosaxml is a streaming XML decoder and encoder, similar in interface to the encoding/xml, but with a focus on performance, low memory footprint and on

Aug 21, 2022
CPU usage percentage is the ratio of the total time the CPU was active, to the elapsed time of the clock on your wall.

Docker-Kubernetes-Container-CPU-Utilization Implementing CPU Load goroutine requires the user to call the goroutine from the main file. go CPULoadCalc

Dec 15, 2021
Divisão do valor total de uma compra entre uma quantidade de pessoas!

Divisão de Compras ?? Objetivo Receber uma lista de compras com: Itens, Quantidade de cada item, Preço por unidade/peso/pacote de cada item. Em seguid

Jan 9, 2022