2017 © Pedro Peláez
 

library coverallskit

PHP client for coveralls.io

image

cloak/coverallskit

PHP client for coveralls.io

  • Sunday, April 17, 2016
  • by holyshared
  • Repository
  • 1 Watchers
  • 2 Stars
  • 4,449 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 39 Versions
  • 0 % Grown

The README.md

CoverallsKit

Build Status Circle CI Build Status, (*1)

Stories in Ready Scrutinizer Code Quality Coverage Status Dependency Status, (*2)

Latest Stable Version License, (*3)

CoverallsKit is the library for transmitting the report of code coverage to coveralls.
This library works with PHP5.5 or more., (*4)

Requirements

  • PHP >= 5.5
  • Xdebug >= 2.2.2

Installation

Installation that uses the composer., (*5)

  1. Install the composer.
  2. Install the package., (*6)

    composer require cloak/coverallskit --dev

Basic usage

You can generate a json file using the coverallskit/CoverallsReportBuilder.
You just set the code coverage of rows that have been executed.
Code coverage can be obtained easily by using the HHVM and xdebug., (*7)

$travis = new TravisCI( new Environment($_SERVER) );
$service = new CIService($travis);

$builder = new CoverallsReportBuilder();
$builder->token('your repository token')
    ->service($service)
    ->repository(new GitRepository(__DIR__ . '/../'));

$source = new SourceFile('path/to/file');
$source->addCoverage(CoverageResult::executed(1));  //The first line was executed
$source->addCoverage(CoverageResult::unused(2));    //The second line is not executed
$source->addCoverage(CoverageResult::executed(3));  //The third line is executed

$builder->addSource($source);
$builder->build()->saveAs(__DIR__ . '/tmp/coverage.json');

Using a configuration file

If you use a configuration file, you can send the report more easily., (*8)

use coverallskit\BuilderConfiguration;
use coverallskit\CoverallsReportBuilder;

$configuration = BuilderConfiguration::loadFromFile('coveralls.toml');
$builder = CoverallsReportBuilder::fromConfiguration($configuration);
$builder->build()->save()->upload();

Configuration file format

It is also possible to use a configuration file.
The file format is toml format., (*9)

token = "{api-token}"
service = "travis-ci"
repositoryDirectory = "."

[reportFile]
output = "script/coveralls.json"

[reportFile.input]
type = "lcov"
file = "script/report.lcov"

File format

Name Required Default Description
token optional COVERALLS_REPO_TOKEN coveralls.io api token. If you do not specify, use the environment variable COVERALLS_REPO_TOKEN.
service optional travis-ci CI(Continuous Integration) service name. You can use the travis-ci or travis-pro or circle-ci or drone.io or codeship
reportFile optional Please look at the reportFile section.
repositoryDirectory optional . Directory path of the git repository. Will specify a relative path from the directory containing the configuration file.

reportFile

imput
Name Required Default Description
type optional Will specify the file type in the code coverage report. You can specify the lcov or clover.
file optional coveralls.json Will specify a file of code coverage report.
output

will specify the json file name to be sent to the coveralls.io.
Will specify a relative path from the directory containing the configuration file., (*10)

Task for Robo

Support the robo of tasks, so you can easily send a report.
Please look at the robo-coveralls-kit for more information., (*11)

Detailed documentation

Run only unit test

composer test

How to run the example

vendor/bin/robo example:basic

The Versions

27/07 2014

1.2.3

1.2.3.0

CoverallsKit is the library for transmitting the report of code coverage to coveralls.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Noritaka Horio

report coveralls code coverage

27/07 2014

1.2.2

1.2.2.0

CoverallsKit is the library for transmitting the report of code coverage to coveralls.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Noritaka Horio

report coveralls code coverage

18/06 2014

1.2.1

1.2.1.0

CoverallsKit is the library for transmitting the report of code coverage to coveralls.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Noritaka Horio

report coveralls code coverage

18/06 2014

1.2.0

1.2.0.0

CoverallsKit is the library for transmitting the report of code coverage to coveralls.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Noritaka Horio

report coveralls code coverage

29/03 2014

1.1.0

1.1.0.0

CoverallsKit is the library for transmitting the report of code coverage to coveralls.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Noritaka Horio

report coveralls code coverage

23/03 2014

1.0.0

1.0.0.0

CoverallsKit is the library for transmitting the report of code coverage to coveralls.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Noritaka Horio

report coveralls code coverage