alxvng/qatracker

QATracker is a tool to collect, store and render quality assurance indicators.

v0.5.0 2020-04-18 15:49 UTC

This package is auto-updated.

Last update: 2024-10-29 05:35:01 UTC


README

Quality

QATracker

QATracker is a tool to collect, store and render quality assurance indicators.
For example, you can run on your project some static code analysis tools like phploc or phpcpd then collect some metrics throught exported files. This specific collected data are stored in an other file that you can push to your repository if you want.

QATracker report image

Demo

You can view an example of a report here : Demo

Requirements

You can view the requirements on packagist website : https://packagist.org/packages/alxvng/qatracker

Installation

If necessary, remove the previous installation :

rm qatracker.phar;

Install the phar (master):

wget https://github.com/alxvgt/qa-tracker/raw/master/release/qatracker.phar

If you prefer more stable version, checkout the last stable release at https://github.com/alxvgt/qatracker/releases

Usage

How to run qatracker :

php qatracker.phar

First time

  1. Run your favorite QA tools and produce log files
  2. Run qatracker, if no configuration file is detected, the tool generate a sample for you.
  3. Adapt the generated sample file to your metrics logs, then run again the tool.
  4. An html page report will be generated, you can open it in your favorite browser. You can see the report but empty charts (not enough values collected).

Note : at least two collects of metrics are needed to display an historization chart.

Periodic usage

  1. Run your favorite QA tools and produce log files, again
  2. Run again qatracker, it collect new metrics from the same qa tools log files paths that you have already configured then, it generate a new report with old and new values.
  3. Now you can see the history of your favorite metrics. Enjoy !

Configuration config.yaml

You need to put your own configuration in order to build your own indicators and reports. The configuration is based on two objects :

  • dataSerie : this object enables you to pick/fetch data in any file you want. Each run of qatracker run each dataSerie provider and store in a file the currated data.
  • chart : this object associate a dataSerie to a chart in the final report
qatracker:
    dataSeries:
        [list of your data series]
    charts:
        [list of your charts]

Example: You can see the default config file at .qatracker.dist/config.yaml

dataSeries

You need to follow this structure and replace variable between brackets :

[id]:
    class: [provider class]
    arguments:
        - [path to a qa tool log file]
        - [expression to retrieve data in the file (xpath, jsonpath, etc.)]

Available provider classes:

  • Alxvng\QATracker\DataProvider\XPathProvider : pick a unique data in a xml file
  • Alxvng\QATracker\DataProvider\XPathSumProvider : pick many data in a xml file and reduce it with a sum
  • Alxvng\QATracker\DataProvider\XPathCountProvider : count nodes retrieved by the expresion in the xml file
  • Alxvng\QATracker\DataProvider\XPathAverageProvider : pick many data in a xml file and compute the average
  • Alxvng\QATracker\DataProvider\JsonPathProvider : pick a unique data in a json file
  • Alxvng\QATracker\DataProvider\JsonPathSumProvider : pick many data in a json file and reduce it with a sum
  • Alxvng\QATracker\DataProvider\JsonPathCountProvider : count nodes retrieved by the expresion in the json file
  • Alxvng\QATracker\DataProvider\JsonPathAverageProvider : pick many data in a json file and compute the average

Example:

total-duplicated-lines:
    class: Alxvng\QATracker\DataProvider\XpathSumProvider
    arguments:
        - '/tmp/qa-logs/phpcpd/log.xml'
        - '/pmd-cpd/duplication/@lines'

charts

You need to follow this structure and replace variable between brackets :

[id]:
    type: [graph type class]
    dataSeries:
        - [data serie id]
    graphSettings:
        [graph settings]

Graph type classes : You can find all available graph options in the library documentation : https://www.goat1000.com/svggraph.php#graph-types

Data serie id : You should refer to a data serie defined in the previous section.

Graph settings : You can find all available graph options in the library documentation : https://goat1000.com/svggraph-options.php

Example:

total-duplicated-lines:
    type: Goat1000\SVGGraph\LineGraph
    dataSeries:
        - 'total-duplicated-lines'
    graphSettings:
        graph_title: 'Totla duplicated lines'

Compose your configuration with imports

You can compose the main config.yaml with others config files by using imports directive. The imported files are processed first then the content of config.yaml

imports:
    - { resource: config-phploc.yaml }

Docs & QA

Some informations about this tool are available here : Docs

Contributing

You can contribute to this project by adding issue or pull request. In order to start the project, you can follow some instructions below :

Requirements

  • docker >= 19.03.5
  • docker-compose >= 1.25.0

Installation

First, fork this repository. Then, follow some instructions below.

git clone <your-fork-repository-url>
cd qatracker/docker
make start
make connect

You are now connected to the container and you can start working on the project