Tooling and libraries for processing dart test output into dev-friendly formats

Overview

better_test_reporter

Build status License: MIT Maintenance

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

  1. 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.
  2. 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.
  3. When generating the XML for a test case, better_test_reporter defaults to stripping the current working directory out of the classname.
Comments
  • feat: Switch to analyzer that annotates on the PR

    feat: Switch to analyzer that annotates on the PR

    📰 Summary of changes

    Switches out our analyze step for one produces by invertase that will annotate the issues on the PR itself

    https://github.com/invertase/github-action-dart-analyzer

    Reviewers

    /domain @Betterment/better_test_reporter-maintainers /no-platform

    opened by CelticMajora 18
  • chore: Upgrade dart version and pub deps

    chore: Upgrade dart version and pub deps

    📰 Summary of changes

    Upgrades dart sdk version as well as dev dependencies for:

    • build_runner
    • freezed
    • json_serializable
    • test

    Reviewers

    /domain @Betterment/better_test_reporter-maintainers /no-platform

    approved 
    opened by CelticMajora 17
  • chore: Update dependencies and README

    chore: Update dependencies and README

    📰 Summary of changes

    • Add pub badge to README
    • Update all dependencies to their most recent versions

    Reviewers

    /domain @Betterment/better_test_reporter-maintainers /no-platform

    opened by CelticMajora 15
  • feat(file-path): remove file:// protocol prefix

    feat(file-path): remove file:// protocol prefix

    📰 Summary of changes

    What is the new functionality added in this PR?

    I'm proposing that we strip out the file:// protocol if it's present in the file path before we populate the file and classname properties in the junit report. I think that keeping it in creates a bunch of noise in the output (you can see this in the test result diff).

    🧪 Testing done

    What testing was added to cover the functionality added in this PR

    Updated automated tests.

    /domain @CelticMajora @btrautmann /no-platform

    approved 
    opened by samandmoore 12
  • fix: Add nanda back to PR template for the time being

    fix: Add nanda back to PR template for the time being

    📰 Summary of changes

    Since nanda is going to be present in this repo for the foreseeable future, adding back in review requests to the PR template

    Reviewers

    /domain @Betterment/better_test_reporter-maintainers /platform @Betterment/better_test_reporter-maintainers

    opened by CelticMajora 7
  • fix: update version and add disclaimer

    fix: update version and add disclaimer

    📰 Summary of changes

    Shifts version down to 0.0.1 and adds a disclaimer to the readme about experimental nature.

    /domain @samandmoore @btrautmann /no-platform

    domain-not-claimed 
    opened by CelticMajora 6
  • docs: Make README improvements

    docs: Make README improvements

    📰 Summary of changes

    Adds more detail to README Resolves https://github.com/Betterment/better_test_reporter/issues/7

    /domain @samandmoore @btrautmann /no-platform

    approved 
    opened by CelticMajora 5
  • fix(pana): Update build config to fix pana score

    fix(pana): Update build config to fix pana score

    📰 Summary of changes

    Adds ignores for naming produced by json_serializable in order to fix pana score.

    Reviewers

    /domain @Betterment/better_test_reporter-maintainers /no-platform

    approved 
    opened by CelticMajora 4
  • chore: Update dependencies 9/22

    chore: Update dependencies 9/22

    📰 Summary of changes

    Updates the following:

    • dart sdk to 2.18.1
    • build_runner to 2.2.1
    • freezed to 2.1.0
    • json_serializable to 6.3.2
    • lints to 2.0.0
    • test to 1.21.6
    • args to 2.3.1
    • freezed_annotation to 2.1.0
    • json_annotation to 4.6.0
    • pub_semver to 2.1.1
    • xml to 6.1.0

    🧪 Testing done

    Kept with existing tests to verify output was unchanged

    opened by CelticMajora 3
  • chore: Release 0.1.1

    chore: Release 0.1.1

    📰 Summary of changes

    Changelog and pubspec changes needed for release 0.1.1

    Reviewers

    /domain @Betterment/better_test_reporter-maintainers @btrautmann /no-platform

    approved 
    opened by CelticMajora 3
  • chore: Rollback dependabot

    chore: Rollback dependabot

    📰 Summary of changes

    😢 looks like dependabot wasn't working and potentially broke other stuff

    Reviewers

    /domain @Betterment/better_test_reporter-maintainers @samandmoore @btrautmann /no-platform

    approved 
    opened by CelticMajora 3
  • Split out application package and library package

    Split out application package and library package

    Is your feature request related to a problem? Please describe. Right now, better_test_reporter acts as both an application package and a library package. According to the dart docs, these are meant to be split apart into two separate packages.

    Describe the solution you'd like This could be done in a this same repo by making it a monorepo for two packages, one for the application and one for the libraries. This would keep all the code in one place as the two are heavily related anyway.

    Describe alternatives you've considered This could also be split out into two entirely separate repos, but I don't think that is necessary.

    Additional context In order to migrate safely, the application package would need to remain named better_test_reporter, but then the other package could be named whatever. We'd need to have a changelog note for better_test_reporter whenever the split is to point any users to the new package if they were previously depending on better_test_reporter as a library.

    enhancement 
    opened by CelticMajora 0
  • Fix LICENSE to recognize MIT

    Fix LICENSE to recognize MIT

    Is your feature request related to a problem? Please describe. Right now, the license is not recognized as MIT due to us including references to licenses of code we adapted this package off of

    Describe the solution you'd like Figure out how github determines license and restructure file to fit.

    enhancement 
    opened by CelticMajora 0
Releases(v0.1.1)
  • v0.1.1(Mar 10, 2022)

    What's Changed

    • chore: Add dependabot for github actions by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/34
    • chore: Add pana verification by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/35
    • chore: Rollback dependabot by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/38
    • fix(pana): Update build config to fix pana score by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/39

    Full Changelog: https://github.com/Betterment/better_test_reporter/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Feb 11, 2022)

    What's Changed

    • chore: Update dependencies and README by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/29
    • feat: Switch to analyzer that annotates on the PR by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/30
    • chore: Upgrade dart version and pub deps by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/31
    • chore: Randomize CI test order by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/32
    • chore: Release 0.1.0 by @CelticMajora in https://github.com/Betterment/better_test_reporter/pull/33

    Full Changelog: https://github.com/Betterment/better_test_reporter/compare/v0.0.1...v0.1.0

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(Nov 2, 2021)

Owner
Betterment
We're passionate about building the simplest, most sophisticated investment platform on the planet. Visit us at www.betterment.com/jobs.
Betterment
Flutter WebRTC demo with Python server to perform image processing on video frames using OpenCV

flutter + webrtc => python + aiortc + opencv This demo project should help you to get setup sending a video feed from a flutter app to a python backen

John Crisp 42 Dec 29, 2022
The Dart SDK, including the VM, dart2js, core libraries, and more.

Dart A client-optimized language for fast apps on any platform Dart is: Optimized for UI: Develop with a programming language specialized around the n

Dart 8.7k Jan 2, 2023
The official sdk for the user-friendly API of Mega services on the Dart language.

megasdkdart The official sdk for the user-friendly API of Mega services in the Dart language. Example: import 'package:megasdkdart/megasdkdart.dart';

meg4cyberc4t 4 Mar 30, 2022
Friendly-Chat - Simple text messaging app coded in Dart using the Flutter framework

Friendly Chat A mobile application coded in the Dart programming language using

Vladislav Kostic 3 May 15, 2022
Libraries supporting GraphQL in Dart

gql-dart/gql This is an effort to advance the Dart GraphQL ecosystem. It consists of multiple packages and libraries centered around GraphQL AST. Core

GQL Dart 240 Dec 2, 2022
Adopt a friendly pet or item

android_register Registering users on Android Getting Started $ flutter clean $ flutter upgrade $ flutter pub get $ flutter run App on pre registratio

Srinjoy Chakravarty 3 Apr 28, 2021
Your friendly neighborhood application.

Welcome to Aas Pass ?? Inspiration Time and again we have observed an on-the-spot need for borrowing daily devices, enquiring about essential services

Satwik Dudeja 3 May 30, 2021
A beginner friendly flutter app displaying the time across various cities in the world.

World Time App in FLUTTER My first kinda big Flutter project. It is a revision of all basics and some advanced concepts of Flutter I've learnt so far.

Rohini Rao 5 Nov 11, 2022
Tiny mobile-friendly scrollytelling library

scrollytell This is a tiny JavaScript library for creating animations that synchronize with scrolling. It uses requestAnimationFrame to check the scro

Google 55 Nov 7, 2022
Asclepius is a medical user-friendly A.I mobile application that serves as an A.I doctor

Asclepius is a medical user-friendly A.I mobile application that serves as an A.I doctor, and also gives people the power to check their health status directly from their phones at no cost.

Surafel Getachew 3 Aug 29, 2022
a project for learning all Flutter Widgets , sync from flutter.dev the officia website.

Flutter Widgets Catalog (WIP) 计划 1、使用Flutter开发一个全平台的Flutter Widgets Catalog APP,并且开源。在这个APP中可以通过图形化的方式查看所有Widgets的介绍,示例,视频教程。 2、所有文档内容由前一天从flutter.dev

ezshine 32 Aug 3, 2022
Materiale per il corso PON Programmazione Creativa dell'ITET Marsala - Modulo Mobile Dev

modulomobiledev-ponprogrammazionecreativa-itet Materiale a supporto delle lezioni del modulo Mobile Dev per il corso PON Programmazione Creativa degli

Enrico La Sala 3 Nov 8, 2021
An flutter package to use DevIcons https://devicon.dev/

dev_icons This flutter package allows you to use all the Dev Icons. You can view the icons catalog on devicon.dev Installation In the dependencies: se

Festus Olusegun 22 Oct 9, 2022
This Dart package will utilize the plugin, google_mobile_ads, so to quickly and easily implement ads into a Flutter app.

Ads to your App in a Snap! This Dart package will utilize the plugin, google_mobile_ads, so to quickly and easily implement ads into a Flutter app

Andrious Solutions Ltd. 58 Sep 11, 2022
Test telegram bot written in dart using teledart package

Dart-Tg-Bot Test telegram bot written in dart using teledart package. Run on local machine First install dart Clone the bot's source and install depen

I'm Not A Bot #Left_TG 8 Oct 31, 2022
Quiz App is cross-platform mobile app, that allows you to test your knowledge on various technologies through quizzes. It's built with Flutter & Dart

Quiz App is cross-platform mobile app, that allows you to test your knowledge on various technologies through quizzes. It's built with Flutter & Dart

Régis 6 Sep 19, 2022
BankGit helps you manage your account and transactions more efficiently by breaking your account into branches for various purposes and then making transactions directly from them.

Bank Git Web Hosted Here : https://bank-management-45848.web.app/ Bank Git is an application built with Flutter and Firebase to help you manage your b

Yash Johri 27 Dec 26, 2022
Caching with flutter riverpod and looking into future providers. Example to demonstrate stale while revalidate pattern.

FLUTTER SWR EXAMPLE Test stale-while-revalidate pattern with riverpod. Look; query_provider package Backend calls are made with ghibli-api Tested Prov

Dipesh Dulal 7 Jun 30, 2022
A study about clean architecture and TDD(Test Driven Development) in Flutter.

coin_checker A study about clean architecture and TDD(Test Driven Development) in Flutter. Getting Started This project is a starting point for a Flut

null 2 Jan 25, 2022