Dart 테스트 JSON 출력을 JUnit XML 형식으로 변환하는 명령줄 도구와 라이브러리 세트로, CI/CD 통합에 이상적입니다. 또한 개발자 친화적인 방식으로 테스트 결과를 파싱할 수 있는 구조화된 모델도 제공합니다. Flutter 또는 Dart 프로젝트를 사용하고 Android, iOS, Web, macOS, Windows, Linux 등 다양한 플랫폼에서 표준화된 테스트 보고서가 필요한 팀을 위해 설계되었습니다. 이 패키지는 테스트 결과 분석을 간소화하고 자동화된 파이프라인에서의 가시성을 향상시킵니다.
사용 사례
CI/CD 테스트 보고서
Jenkins 또는 GitHub Actions와의 통합
표준화된 테스트 보고서 생성
프로그래밍 방식으로 테스트 결과 분석하기
크로스 플랫폼 테스트 검증
테스트 결과의 가독성 향상
주요 기능
테스트용 JSON을 JUnit XML로 변환
개발자 친화적인 테스트 결과 모델을 제공합니다
여러 플랫폼을 지원합니다
간편한 CLI 통합
확장 가능한 구문 분석 유틸리티
깨끗하고 구조화된 출력
적합한 대상
Flutter 및 Dart를 사용하는 팀
CI/CD 파이프라인 개발자
테스트 자동화 엔지니어
JUnit 호환성이 필요한 프로젝트
구조화된 테스트 데이터가 필요한 개발자
고려 사항
Dart 테스트 JSON 입력이 필요합니다
CI 워크플로우에서 설정이 필요합니다
테스트 보고 사용 사례에 제한됨
실시간 테스트 지원 없음
외부 테스트 프레임워크 출력에 의존
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
better_test_reporter
Introduction
This is an application/library heavily inspired by
dart-junitreport and
dart-testreport. It takes what was
done in those two packages and brings them under a single umbrella, updates to
null-safety, and makes various code style improvements.
The purpose of this package is three-fold:
Firstly, it provides models by which output from the test json
reporter
can be decoded.
Secondly, it provides a processor that will take a full json
report from the test json reporter and generate a more developer-friendly report
model structure that is agnostic to the protocol version of the test json
reporter.
Thirdly, it is a command-line application(report_to_junit) that
can be used to take in a full json report from the test json reporter and
generate a junit XML report(usable by many CI tools)
Experimental nature
This package is still experimental as we continue to build out more functionality. It's current state is barebones as we investigate ways to make the junit output more useful and ways to produce better testing reports for use outside of just junit.
Getting Started
In order to start using the report_to_junit command, install the latest
better_test_reporter as a global package via pub.dev.
pub global activate better_test_reporter
Options
Details on all options for report_to_junit can be found by running report_to_junit --help
> report_to_junit --help
-i, --input the path to the 'json' file containing the output of 'pub run test'.
if missing, <stdin> will be used
-o, --output the path of the to be generated junit xml file.
if missing, <stdout> will be used
-b, --base the part to strip from the 'path' elements in the source
(defaults to the current working directory)
-p, --package the part to prepend to the 'path' elements in the source
(defaults to "")
-t, --timestamp the timestamp to be used in the report
- 'now' will use the current date/time
- 'none' will suppress timestamps altogether
- a date formatted 'yyyy-MM-ddThh:mm:ss' will be used as UTC date/time
- if no value is provided
- if'--input' is specified the file modification date/time is used
- otherwise the current date/time is used
-h, --help display this help text
Misc
Differences from original implementation in dart-junitreport and dart-testreport
When generating the XML for a problem during a test, dart-junitreport had a
special case for only one problem occurred. The multiple problem case also
handled the case for a single problem. We found the special case for a single
problem unneeded and a little buggy, so it was removed in
better_test_reporter.
When parsing the test reporter json into a report,
dart-testreport set tests as not hidden if they encountered any problems while
running. In better_test_reporter, the hidden attribute on a test will be
purely based on whether the test was explicitly hidden based on the
TestDoneEvent json. That said, we maintained the hidden behavior for the
output junit xml by shifting that decision out of the report and up to whatever
consumes the report.
When generating the XML for a test case, better_test_reporter defaults to
stripping the current working directory out of the classname.