From 9c6ddedfe44300fe4d63ac5eeb95a1f359bbccc9 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 30 Mar 2022 07:59:41 -0700 Subject: [PATCH] initial implementation of a github actions reporter (#1678) implementation of a github actions reporter --- pkgs/test/CHANGELOG.md | 6 +- pkgs/test/README.md | 19 + pkgs/test/pubspec.yaml | 2 +- .../test/runner/github_reporter_test.dart | 346 ++++++++++++++++++ pkgs/test/test/runner/runner_test.dart | 13 +- pkgs/test_api/lib/src/backend/declarer.dart | 7 +- .../lib/src/runner/configuration/args.dart | 3 +- .../src/runner/configuration/reporters.dart | 14 +- .../lib/src/runner/reporter/github.dart | 198 ++++++++++ pkgs/test_core/lib/src/util/io.dart | 6 + 10 files changed, 603 insertions(+), 11 deletions(-) create mode 100644 pkgs/test/test/runner/github_reporter_test.dart create mode 100644 pkgs/test_core/lib/src/runner/reporter/github.dart diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index 27e2fcd70..0d3ecb965 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,4 +1,8 @@ -## 1.20.3-dev +## 1.21.0-dev + +* Add a `github` reporter option for use with GitHub Actions. +* Make the `github` test reporter the default when we detect we're running on + GitHub Actions. ## 1.20.2 diff --git a/pkgs/test/README.md b/pkgs/test/README.md index 8cc53e9b9..ea8d5b8f2 100644 --- a/pkgs/test/README.md +++ b/pkgs/test/README.md @@ -3,6 +3,8 @@ * [Writing Tests](#writing-tests) * [Running Tests](#running-tests) * [Sharding Tests](#sharding-tests) + * [Shuffling Tests](#shuffling-tests) + * [Selecting a Test Reporter](#selecting-a-test-reporter) * [Collecting Code Coverage](#collecting-code-coverage) * [Restricting Tests to Certain Platforms](#restricting-tests-to-certain-platforms) * [Platform Selectors](#platform-selectors) @@ -209,6 +211,7 @@ the invocation to the `test` function, and are considered a match if on platform implementations. ### Sharding Tests + Tests can also be sharded with the `--total-shards` and `--shard-index` arguments, allowing you to split up your test suites and run them separately. For example, if you wanted to run 3 shards of your test suite, you could run them as follows: @@ -233,6 +236,22 @@ dart test --test-randomize-ordering-seed=random Setting `--test-randomize-ordering-seed=0` will have the same effect as not specifying it at all, meaning the test order will remain as-is. +### Selecting a Test Reporter + +You can adjust the output format of test results using the `--reporter=