Skip to content

Commit 0eddae4

Browse files
authored
Document the silent reporter (#2163)
Towards #2162 Unhide the silent reporter. This was originally introduced hidden because we expected it to only be useful for our own CI infrastructure, since a failure without any output cannot be investigated - it must be reproduced in a separate run to even find which test case failed. We now have an external request for failing without any output on stdio and there is no strong reason to keep the silent reporter hidden. Remove the support for hidden reporters entirely - it can easily be reintroduced if we have another reporter which isn't user facing. Expand the reporter description. Break a long description string into a adjacent literals to avoid lines over 80 columns.
1 parent 846d73e commit 0eddae4

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

pkgs/test/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## 1.25.1-wip
22

3+
* Document the silent reporter in CLI help output.
4+
35
## 1.25.0
46

57
* Handle paths with leading `/` when spawning test isolates.

pkgs/test/test/runner/runner_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Output:
110110
[expanded] (default) A separate line for each update.
111111
[github] A custom reporter for GitHub Actions (the default reporter when running on GitHub Actions).
112112
[json] A machine-readable format (see https://dart.dev/go/test-docs/json_reporter.md).
113+
[silent] A reporter with no output. May be useful when only the exit code is meaningful.
113114
114115
--file-reporter Enable an additional reporter writing test results to a file.
115116
Should be in the form <reporter>:<filepath>, Example: "json:reports/tests.json"

pkgs/test_core/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.6.1-wip
22

3-
- Handle missing package configs.
3+
* Handle missing package configs.
4+
* Document the silent reporter in CLI help output.
45

56
## 0.6.0
67

pkgs/test_core/lib/src/runner/configuration/args.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ final ArgParser _parser = (() {
139139

140140
var reporterDescriptions = <String, String>{
141141
for (final MapEntry(:key, :value) in allReporters.entries)
142-
if (!value.hidden) key: value.description
142+
key: value.description
143143
};
144144

145145
parser.addSeparator('Output:');

pkgs/test_core/lib/src/runner/configuration/reporters.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ typedef ReporterFactory = Reporter Function(Configuration, Engine, StringSink);
2222
class ReporterDetails {
2323
final String description;
2424
final ReporterFactory factory;
25-
final bool hidden;
26-
ReporterDetails(this.description, this.factory, {this.hidden = false});
25+
ReporterDetails(this.description, this.factory);
2726
}
2827

2928
/// All reporters and their corresponding details.
@@ -48,7 +47,8 @@ final _allReporters = <String, ReporterDetails>{
4847
printPlatform: config.suiteDefaults.runtimes.length > 1 ||
4948
config.suiteDefaults.compilerSelections != null)),
5049
'github': ReporterDetails(
51-
'A custom reporter for GitHub Actions (the default reporter when running on GitHub Actions).',
50+
'A custom reporter for GitHub Actions '
51+
'(the default reporter when running on GitHub Actions).',
5252
(config, engine, sink) => GithubReporter.watch(engine, sink,
5353
printPath: config.testSelections.length > 1 ||
5454
Directory(config.testSelections.keys.single).existsSync(),
@@ -60,8 +60,8 @@ final _allReporters = <String, ReporterDetails>{
6060
(config, engine, sink) =>
6161
JsonReporter.watch(engine, sink, isDebugRun: config.debug)),
6262
'silent': ReporterDetails(
63-
hidden: true,
64-
'A reporter with no output.',
63+
'A reporter with no output. '
64+
'May be useful when only the exit code is meaningful.',
6565
(config, engine, sink) => SilentReporter()),
6666
};
6767

0 commit comments

Comments
 (0)