Revert "Allow Flutter golden file tests to be flaky (#114450)" (#114902)

This reverts commit 53e6876226.
This commit is contained in:
Zachary Anderson
2022-11-08 09:26:55 -08:00
committed by GitHub
parent a1432a9c5d
commit a84e369bd2
35 changed files with 1351 additions and 2093 deletions

View File

@@ -1,16 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This would fail analysis, but it is ignored
// flutter_ignore_for_file: golden_tag (see analyze.dart)
@Tags(<String>['some-other-tag'])
import 'package:test/test.dart';
import 'golden_class.dart';
void main() {
expectFlakyGolden('key', 'String');
}

View File

@@ -1,14 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The reduced test set tag is missing. This should fail analysis.
@Tags(<String>['some-other-tag'])
import 'package:test/test.dart';
import 'golden_class.dart';
void main() {
expectFlakyGolden('finder', 'missing_tag.png');
}

View File

@@ -1,11 +0,0 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The tag is missing. This should fail analysis.
import 'golden_class.dart';
void main() {
expectFlakyGolden('key', 'missing_tag.png');
}

View File

@@ -7,7 +7,3 @@
void matchesGoldenFile(Object key) {
return;
}
void expectFlakyGolden(Object key, String string){
return;
}

View File

@@ -35,11 +35,8 @@
/// ```
/// {@end-tool}
///
/// expectFlakyGolden(a, b)
// Other comments
// matchesGoldenFile('comment.png');
// expectFlakyGolden(a, b);
String literal = 'matchesGoldenFile()'; // flutter_ignore: golden_tag (see analyze.dart)
String flakyLiteral = 'expectFlakyGolden';

View File

@@ -79,9 +79,7 @@ void main() {
'at the top of the file before import statements.';
const String missingTag = "Files containing golden tests must be tagged with 'reduced-test-set'.";
final List<String> lines = <String>[
'║ test/analyze-test-input/root/packages/foo/flaky_golden_no_tag.dart: $noTag',
'║ test/analyze-test-input/root/packages/foo/golden_missing_tag.dart: $missingTag',
'║ test/analyze-test-input/root/packages/foo/flaky_golden_missing_tag.dart: $missingTag',
'║ test/analyze-test-input/root/packages/foo/golden_no_tag.dart: $noTag',
]
.map((String line) => line.replaceAll('/', Platform.isWindows ? r'\' : '/'))