Skip to content

dont log the --test-randomization-ordering-seed if using the json reporter #1548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Remove support for `FORCE_TEST_EXIT`.
* Report incomplete tests as errors in the JSON reporter when the run is
canceled early.
* Don't log the --test-randomization-ordering-seed if using the json reporter.

## 0.3.29

Expand Down
10 changes: 8 additions & 2 deletions pkgs/test_core/lib/src/runner/configuration/args.dart
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,18 @@ class _Parser {
}
}

var reporter = _ifParsed('reporter') as String?;

var testRandomizeOrderingSeed =
_parseOption('test-randomize-ordering-seed', (value) {
var seed = value == 'random'
? Random().nextInt(4294967295)
: int.parse(value).toUnsigned(32);
print('Shuffling test order with --test-randomize-ordering-seed=$seed');

// TODO(#1547): Less hacky way of not breaking the json reporter
if (reporter != 'json') {
print('Shuffling test order with --test-randomize-ordering-seed=$seed');
}

return seed;
});
Expand All @@ -251,7 +257,7 @@ class _Parser {
dart2jsPath: _ifParsed('dart2js-path'),
dart2jsArgs: _ifParsed('dart2js-args'),
precompiledPath: _ifParsed('precompiled'),
reporter: _ifParsed('reporter'),
reporter: reporter,
fileReporters: _parseFileReporterOption(),
coverage: _ifParsed('coverage'),
pubServePort: _parseOption('pub-serve', int.parse),
Expand Down