mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[web] Cleaner output on LUCI (flutter/engine#41989)
Using ansi colors in LUCI results in output that looks like: ``` 00:00 [32m+0[0m: [1m[90mloading flutter_tester_emulation_golden_test.dart[0m[0m 00:01 [32m+0[0m: [1m[90mloading flutter_tester_emulation_golden_test.dart[0m[0m 00:02 [32m+0[0m: [1m[90mloading flutter_tester_emulation_golden_test.dart[0m[0m ``` This PR disables colors on LUCI so that we get clean output that's easily scannable and searchable.
This commit is contained in:
parent
fea415faa0
commit
7b3b362623
@ -84,6 +84,7 @@ class RunSuiteStep implements PipelineStep {
|
||||
'--platform=${browserEnvironment.packageTestRuntime.identifier}',
|
||||
'--precompiled=$bundleBuildPath',
|
||||
'--configuration=$configurationFilePath',
|
||||
if (AnsiColors.shouldEscape) '--color' else '--no-color',
|
||||
|
||||
// TODO(jacksongardner): Set the default timeout to five minutes when
|
||||
// https://github.com/dart-lang/test/issues/2006 is fixed.
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:args/command_runner.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import 'common.dart';
|
||||
import 'environment.dart';
|
||||
import 'exceptions.dart';
|
||||
import 'felt_config.dart';
|
||||
@ -428,7 +429,13 @@ io.Directory getSkiaGoldDirectoryForSuite(TestSuite suite) {
|
||||
}
|
||||
|
||||
extension AnsiColors on String {
|
||||
static bool shouldEscape = io.stdout.hasTerminal && io.stdout.supportsAnsiEscapes;
|
||||
static bool shouldEscape = () {
|
||||
if (isLuci) {
|
||||
// Produce clean output on LUCI.
|
||||
return false;
|
||||
}
|
||||
return io.stdout.hasTerminal && io.stdout.supportsAnsiEscapes;
|
||||
}();
|
||||
|
||||
static const String _noColorCode = '\u001b[39m';
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user