dart_coveralls 0.5.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 52

dart-coveralls

Build Status Coverage Status

Calculate coverage of your dart scripts, format it to LCOV and send it to coveralls.io.

Usage

This package consists of a single command line tool dart_coveralls with the three commands calc, report, upload.

To activate the program for global use, run pub global activate dart_coveralls.

The calc command

This command calculates the coverage of a given package. Use the tool like this:

dart_coveralls calc [--output, --package-root] test.dart
# or
dart_coveralls calc [--output, --packages] test.dart
  • --output: The output file path, if not given stdout
  • --packages: Specifies the path to the package resolution configuration file. This option cannot be used with --package-root. Defaults to ".packages".
  • --package-root: Specifies where to find imported libraries. This option cannot be used with --packages. Defaults to null.
  • test.dart: The path of the test file on which coverage will be collected

The report command

This command calculates and then sends the coverage data to coveralls.io. Usage of the tool is as follows:

dart_coveralls report <options> <test file>
  • --help – Displays all options
  • --token –Token for coveralls
  • --packages: Specifies the path to the package resolution configuration file. This option cannot be used with --package-root. Defaults to ".packages".
  • --package-root: Specifies where to find imported libraries. This option cannot be used with --packages. Defaults to null.
  • --debug Prints debug information
  • --retry Number of retries (defaults to "10")
  • --dry-run If this flag is enabled, data won't be sent to coveralls
  • -C, --throw-on-connectivity-error Should this throw an exception, if the upload to coveralls fails?
  • -E, --throw-on-error Should this throw if an error in the dart_coveralls implementation happens?
  • -T, --exclude-test-files Should test files be included in the coveralls report?
  • -p, --print-json Pretty-print the json that will be sent to coveralls.

The upload command

This command uploads a coverage report.

dart_coveralls upload <options> <directory containing coverage reports from the VM>
  • --help – Displays all options
  • --token –Token for coveralls
  • --packages: Specifies the path to the package resolution configuration file. This option cannot be used with --package-root. Defaults to ".packages".
  • --package-root: Specifies where to find imported libraries. This option cannot be used with --packages. Defaults to null.
  • --debug Prints debug information
  • --retry Number of retries (defaults to "10")
  • --dry-run If this flag is enabled, data won't be sent to coveralls
  • -C, --throw-on-connectivity-error Should this throw an exception, if the upload to coveralls fails?
  • -E, --throw-on-error Should this throw if an error in the dart_coveralls implementation happens?
  • -T, --exclude-test-files Should test files be included in the coveralls report?
  • -p, --print-json Pretty-print the json that will be sent to coveralls.

Contributing

Help and Pull Requests are highly appreciated :)

0.5.0

  • Support the latest coverage 0.9.0 series releases.

  • Support for breaking changes introduced with Dart v1.22.0.

  • Added --packages option to all sub commands. It defaults to null, though the file path .packages will be used if no path is given in option --package-root. The --packages and --package-root options cannot be used together.

  • Refactored LcovCollector so that it doesn't duplicate logic already present in coverage.

  • Refactored CommandLineParts to minimize duplicate code.

  • Introduced a timeout of 60 seconds in cases where the VM doesn't respond. This should only be the case if the given test file contains serious syntax errors.

  • #63 --workers is ignored and will be removed in a future release.

  • #71 Submitting to coveralls now uses source_digest option instead of source. This greatly reduces coveralls report upload sizes.

0.4.0

  • Add an upload-only option, which does not run any script

  • Removed LcovCollector ctor testFile argument.

  • LcovCollect.getLcovInformation added testFile argument.

  • Added --log-level option to the report sub command.

0.3.0+1

  • Support the latest coverage 0.7.0 series releases.

0.3.0

  • serviceName was removed from CommandLineClient.

  • serviceName and serviceJobId are now named paramaters on CoverallsReport – constructor and parse.

  • service_name and service_job_id are correctly populated form Travis and Coveralls.

  • Can omit the token flag to report if one of REPO_TOKEN or COVERALLS_TOKEN is set as an environment variable.

  • The Coveralls job number and URL are printed after a successful report is posted to the service.

0.2.0

  • A number of (breaking) changes to clarify and correctly distinguish between projectDirectory – the directory containing the source project – and packageRoot – the directory containing the project packages, usually located at <projectDirectory>/packages.

  • A number of (breaking) changes to pass around paths – as String – instead of File and Directory instances.

  • CommandLinePart and subtypes execute methods are now explicitly async.

  • Added a lot more logging, especially in error cases.

  • covString and related are removed from all classes. Using standard toJson method supported by dart:convert JSON.

  • A number of public helper methods were moved to private, top-level functions.

  • Added a print-json option to report.

  • LcovCollector now puts coverage output in a temporary directory.

  • CommandLineClient and LcovCollector removed dependency on FileSystem. Constructors and fields were changed accordingly.

  • LcovCollector now parses all coverage output files. There is a lot less missed coverage, especially when isolates are being used.

  • Minimum version of coverage was bumped to 0.6.4.

0.1.12

  • Support latest versions of args and coverage packages.

  • Require at least Dart 1.9.0 SDK.

  • Improved the reporting of errors, especially async errors.

  • Add check of CI_BRANCH environment variable for Git branch.

1. Depend on it

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


dependencies:
  dart_coveralls: "^0.5.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:dart_coveralls/dart_coveralls.dart';
        
Version Uploaded Documentation Archive
0.5.0 Mar 3, 2017 Go to the documentation of dart_coveralls 0.5.0 Download dart_coveralls 0.5.0 archive
0.4.0 Jul 15, 2015 Go to the documentation of dart_coveralls 0.4.0 Download dart_coveralls 0.4.0 archive
0.3.0+1 Jun 9, 2015 Go to the documentation of dart_coveralls 0.3.0+1 Download dart_coveralls 0.3.0+1 archive
0.3.0 May 30, 2015 Go to the documentation of dart_coveralls 0.3.0 Download dart_coveralls 0.3.0 archive
0.2.0 May 26, 2015 Go to the documentation of dart_coveralls 0.2.0 Download dart_coveralls 0.2.0 archive
0.1.12 May 20, 2015 Go to the documentation of dart_coveralls 0.1.12 Download dart_coveralls 0.1.12 archive
0.1.11 Mar 10, 2015 Go to the documentation of dart_coveralls 0.1.11 Download dart_coveralls 0.1.11 archive
0.1.10 Feb 2, 2015 Go to the documentation of dart_coveralls 0.1.10 Download dart_coveralls 0.1.10 archive
0.1.9 Jan 8, 2015 Go to the documentation of dart_coveralls 0.1.9 Download dart_coveralls 0.1.9 archive
0.1.8 Dec 22, 2014 Go to the documentation of dart_coveralls 0.1.8 Download dart_coveralls 0.1.8 archive

All 34 versions...

Analysis

We analyzed this package on Apr 9, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.46.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
9 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90 / 100
Overall score:
Weighted score of the above. [more]
52
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:dart_coveralls/dart_coveralls.dart with components: io.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dart_coveralls.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 hints.

    Strong-mode analysis of lib/src/cli_client.dart gave the following hint:

    line: 136 col: 21
    'JSON' is deprecated and shouldn't be used.

    Strong-mode analysis of lib/src/collect_lcov.dart gave the following hint:

    line: 5 col: 28
    'UTF8' is deprecated and shouldn't be used.

    Similar analysis of the following files failed:

    • lib/src/coveralls_endpoint.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.16.0 <2.0.0
args >=0.12.0+2 <0.14.0 0.13.7 1.4.1
coverage ^0.9.2 0.9.3 0.10.0
crypto ^2.0.1 2.0.2+1
http >=0.11.1+1 <0.12.0 0.11.3+16
logging >=0.9.2 <0.12.0 0.11.3+1
mockable_filesystem >=0.0.3 <0.1.0 0.0.3
path ^1.3.0 1.5.1
stack_trace ^1.3.2 1.9.2
yaml ^2.1.2 2.1.13
Transitive dependencies
async 2.0.6
charcode 1.1.1
collection 1.14.9
convert 2.0.1
http_parser 3.1.1
json_rpc_2 2.0.7
package_config 1.0.3
pub_semver 1.3.5
source_span 1.4.0
stream_channel 1.6.4
string_scanner 1.0.2
typed_data 1.1.5
vm_service_client 0.2.4+1
web_socket_channel 1.0.7
Dev dependencies
mock ^0.12.0
test ^0.12.0