junitreport
dart 테스트 실행에서 JUnit XML 보고서를 생성합니다. dart 또는 flutter 테스트의 출력을 JUnit 스타일 XML로 변환합니다
dart 테스트 실행에서 JUnit XML 보고서를 생성하는 애플리케이션입니다.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
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
dart test simple_test.dart --reporter json > example.jsonl
dart 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.
Run dart 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:
dart test simple_test.dart --reporter json | tojunit
And to run all tests for Flutter:
flutter test --machine | tojunit