coveralls 1.0.0

Coveralls for Dart

Runtime Release License Coverage Build

Send LCOV coverage reports to the Coveralls service, in Dart.

Requirements

The latest Dart SDK and Pub versions. If you plan to play with the sources, you will also need the latest Grinder version.

Usage

Command line interface

The easy way. From a command prompt, install the coveralls executable:

$ pub global activate coveralls

Consider adding the pub global executables directory to your system path.

Then use it to upload your coverage reports:

$ coveralls --help
Send a LCOV coverage report to the Coveralls service.

Usage:
pub global run coveralls [options]

Options:
-f, --file=<file>    path to the coverage report
-h, --help           output usage information
-v, --version        output the version number

For example:

$ coveralls -f build/lcov.info

Programming interface

The hard way. Add this to your package's pubspec.yaml file:

dependencies:
  coveralls: *

Then, from a command prompt, install the library:

$ pub get

Now in your Dart code, you can use the Client class to upload your coverage reports:

import 'dart:async';
import 'dart:io';
import 'package:coveralls/coveralls.dart';

Future main() async {
  try {
    var coverage = await new File('/path/to/coverage.report').readAsString();
    await new Client().upload(coverage);
    print('The report was sent successfully.');
  }
  
  catch (error) {
    print('An error occurred: $error');
  }
}

Supported coverage formats

Currently, this package only supports the de facto standard: the LCOV format.

Supported CI services

This project has been tested with Travis CI service, but these services should also work with no extra effort:

Environment variables

If your build system is not supported, you can still use this package. There are a few environment variables that are necessary for supporting your build system:

  • COVERALLS_SERVICE_NAME : the name of your build system.
  • COVERALLS_REPO_TOKEN : the secret repository token from Coveralls.

There are optional environment variables:

  • COVERALLS_SERVICE_JOB_ID : a string that uniquely identifies the build job.
  • COVERALLS_RUN_AT : a date string for the time that the job ran. This defaults to your build system's date/time if you don't set it.

The full list of supported environment variables is available in the source code of the Configuration class (see the fromEnvironment() static method).

The .coveralls.yml file

This package supports the same configuration sources as the Coveralls ones:
Coveralls currently supports

See also

License

Coveralls for Dart is distributed under the Apache License, version 2.0.

Changelog

This file contains highlights of what changes on each version of the Coveralls for Dart package.

Version 1.0.0

  • First stable release.

Version 0.3.0

  • Updated the package dependencies.

Version 0.2.0

  • Updated the package dependencies.

Version 0.1.1

  • Updated the documentation.

Version 0.1.0

  • Initial release.

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  coveralls: "^1.0.0"

2. Install it

You can install packages from the command line:

$ pub get

Alternatively, your editor might support 'pub get'. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:coveralls/coveralls.dart';

About

Send LCOV coverage reports to the Coveralls service.

Author

Email cedric@belin.io C├ędric Belin

Homepage

github.com/cedx/coveralls.dart

Documentation

www.dartdocs.org/documentation/coveralls/1.0.0/

Source code (hyperlinked)

www.crossdart.info/p/coveralls/1.0.0/

Uploader

cedxbelin@gmail.com

Published

May 15, 2017

Share