junitreport 1.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 70

JUnit Report #

Introduction #

This application can be used to convert the results of dart tests to JUnit xml reports. These XML reports can then be used by other tools like Jenkins CI.

By running

pub run test simple_test.dart --reporter json > example.jsonl
pub global run junitreport:tojunit --input example.jsonl --output TEST-report.xml

and the contents of simple_test.dart is

import 'package:test/test.dart';

main() {
  test('simple', () {
    expect(true, true);
  });
}

this program will generate 'TEST-report.xml' containing

<testsuites>
  <testsuite errors="0" failures="0" tests="1" skipped="0" name="simple" timestamp="2016-05-22T21:20:08">
    <properties>
      <property name="platform" value="vm" />
    </properties>
    <testcase classname="simple" name="simple" time="0.026" />
  </testsuite>
</testsuites>

For transforming Flutter tests reports, instead of passing --reporter json, you need to use --machine.

Installation #

Run pub global activate junitreport to download the program and make a launch script available: <dart-cache>/bin/tojunit.

If the <dart-cache>/bin directory is not on your path, you will get a warning, including tips on how to fix it.

Once the directory is on your path, tojunit --help should be able to run and produce the program help.

Then you can also use the example above much simpler:

pub run test simple_test.dart --reporter json | tojunit

And to run all tests for Flutter:

flutter test --machine | tojunit

License and contributors #

1.0.1 #

  • updated dependencies:
    • xml: '^3.3.1'
    • intl: '^0.15.7'
    • testreport: '^1.0.0'
    • args: '^1.5.1'

1.0.0 #

  • force Dart 2.1+
  • update dependency xml: '^3.3.0', fix problem with pretty printer

0.3.3 #

  • more dart 2.0 support

0.3.2 #

  • updated dependencies:
    • testreport: '^0.3.1'

0.3.1 #

  • support for Dart 2.0
  • updated dependencies:
    • xml: '^3.0.0'
    • intl: '^0.15.5'
    • args: '^1.4.4'

0.3.0 #

  • updated dependencies:
    • sdk: '>=1.19.0 <2.0.0'
    • xml: '^2.6.0'
    • intl: '^0.15.0'
    • testreport: '^0.3.0'
  • removed transitive dependencies on 'build_collection' and 'quiver'

0.2.1 #

  • restrict dependency on xml to '>= 2.5.0 <2.6.0' because the XmlPrettyWriter moved to a different library
  • use one system-out element to contain all outputs instead of one per output

0.1.0 #

  • Initial implementation

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate junitreport

2. Use it

The package has the following executables:


$ tojunit

Use this package as a library

1. Depend on it

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


dependencies:
  junitreport: ^1.0.1

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 flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:junitreport/junitreport.dart';
  
Version Uploaded Documentation Archive
1.0.1 Jan 31, 2019 Go to the documentation of junitreport 1.0.1 Download junitreport 1.0.1 archive
1.0.0 Jan 28, 2019 Go to the documentation of junitreport 1.0.0 Download junitreport 1.0.0 archive
0.3.3 Sep 3, 2018 Go to the documentation of junitreport 0.3.3 Download junitreport 0.3.3 archive
0.3.2 Jul 20, 2018 Go to the documentation of junitreport 0.3.2 Download junitreport 0.3.2 archive
0.3.1 Jul 19, 2018 Go to the documentation of junitreport 0.3.1 Download junitreport 0.3.1 archive
0.3.0 Sep 20, 2017 Go to the documentation of junitreport 0.3.0 Download junitreport 0.3.0 archive
0.2.1 Sep 20, 2017 Go to the documentation of junitreport 0.2.1 Download junitreport 0.2.1 archive
0.2.0 Jun 2, 2016 Go to the documentation of junitreport 0.2.0 Download junitreport 0.2.0 archive
0.1.0 May 22, 2016 Go to the documentation of junitreport 0.1.0 Download junitreport 0.1.0 archive
0.3.1-dev Jul 19, 2018 Go to the documentation of junitreport 0.3.1-dev Download junitreport 0.3.1-dev archive
Popularity:
Describes how popular the package is relative to other packages. [more]
50
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
77
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:junitreport/junitreport.dart.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/impl/report.dart. (-0.50 points)

Analysis of lib/src/impl/report.dart reported 1 hint:

line 135 col 16: Use isEmpty instead of length

Maintenance suggestions

The package description is too short. (-13 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and junitreport.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
args ^1.5.1 1.5.1
intl ^0.15.7 0.15.8
testreport ^1.0.0 1.0.0
xml ^3.3.1 3.4.1
Transitive dependencies
charcode 1.1.2
collection 1.14.11
convert 2.1.1
path 1.6.2
petitparser 2.2.1
typed_data 1.1.6
Dev dependencies
test any