분류, 패키지 및 저장소 검색

패키지 상세v2.0.1

testreport

이 라이브러리는 Dart 테스트의 결과를 처리하는 데 사용할 수 있습니다. Dart 테스트 러너가 내보내는 `json` 출력 데이터를 처리하고 테스트 결과에 대한 API를 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
34.7만
좋아요
3
Pub 점수
160

패키지 설치

flutter pub add testreport

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

testreport 패키지는 Dart 테스트 러너가 생성한 JSON 출력에서 Dart 테스트 결과를 처리합니다. 이는 통과/실패 상태, 지속 시간, 오류와 같은 의미 있는 정보를 구문 분석하고 분석하며 추출할 수 있도록 구조화된 API를 제공합니다. CI/CD 파이프라인에 테스트 결과를 통합하거나 보고서를 생성하거나 다양한 플랫폼 간 테스트 성능을 시각화하는 데 특히 유용합니다. 이 라이브러리는 모든 주요 Flutter 플랫폼을 지원하여 크로스플랫폼 테스트 워크플로우에 이상적입니다.

사용 사례

  • CI/CD 통합
  • 테스트 결과 분석
  • 자동 보고
  • 크로스 플랫폼 테스트
  • 테스트 대시보드

주요 기능

  • JSON 결과 파싱
  • Platform-agnostic
  • 오류 및 지속 시간 추출
  • 구조화된 데이터 API
  • 모든 플러터 플랫폼을 지원합니다

적합한 대상

  • CI/CD 시스템
  • 테스트 자동화 팀
  • 품질 보증 엔지니어
  • Flutter를 사용하는 개발자
  • 보고 도구

고려 사항

  • dart 테스트 러너에서 JSON 출력이 필요합니다
  • 시험 후 처리에 제한됨
  • 실시간 테스트 모니터링 없음
  • 테스트 러너 출력 형식에 따라 다름
  • 직접 테스트를 실행하기 위한 것이 아님

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Test Report

Introduction

This library can be used to process the results of dart tests.

The goal of this library is to process the data from the json output emitted by the dart test runner and provide an API to the interpreted test results.

Purpose

By running

pub run test simple_test.dart --reporter json

and the contents of simple_test.dart is

import 'package:test/test.dart';

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

the dart test runner will output the results of the test in json format as a stream of events:

{"protocolVersion":"0.1.0","runnerVersion":"0.12.13+1","type":"start","time":0}
{"count":1,"type":"allSuites","time":0}
{"suite":{"id":0,"platform":"vm","path":"simple_test.dart"},"type":"suite","time":0}
{"test":{"id":1,"name":"loading simple_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null}},"type":"testStart","time":0}
{"testID":1,"result":"success","hidden":true,"type":"testDone","time":237}
{"group":{"id":2,"suiteID":0,"parentID":null,"name":null,"metadata":{"skip":false,"skipReason":null},"testCount":1},"type":"group","time":241}
{"test":{"id":3,"name":"simple","suiteID":0,"groupIDs":[2],"metadata":{"skip":false,"skipReason":null}},"type":"testStart","time":242}
{"testID":3,"result":"success","hidden":false,"type":"testDone","time":268}
{"success":true,"type":"done","time":271}

From this json output, it is not easy to see how many tests were executed, how many failed and how much time was spent in each test.

The Processor in this project takes the json events, and turns them into a Report, that is suitable for further processing.

License and contributors

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트