Skip to content

Commit 202d6b7

Browse files
Jonah Williamsmatanlurey
andauthored
[CI] remove check for exact golden files. (#166031)
Instead make sure at least 1 png is generated. --------- Co-authored-by: Matan Lurey <matanlurey@users.noreply.github.com>
1 parent bfe95d3 commit 202d6b7

18 files changed

+24
-1278
lines changed

engine/src/flutter/CONTRIBUTING.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ performance implications. See [#49801][pr_49801] for an example.
5959

6060
#### Linux Embedding
6161

62-
> [!NOTE]
62+
> [!NOTE]
6363
> The Linux embedding instead follows idiomatic GObject-based C style.
6464
6565
Use of C++ in the [Linux embedding][] is discouraged in that embedding to avoid
@@ -215,14 +215,10 @@ in postsubmit.
215215

216216
### Skia Gold
217217

218-
The Flutter engine uses [Skia Gold][skia_gold] for image comparison tests which fail if:
219-
220-
- The image is different from an accepted baseline.
221-
- An image is not uploaded but is expected to be (see
222-
[`dir_contents_diff`][dir_contents_diff]).
218+
The Flutter engine uses [Skia Gold][skia_gold] for image comparison tests which
219+
fail if the image is different from an accepted baseline image.
223220

224221
[skia_gold]: https://flutter-engine-gold.skia.org/
225-
[dir_contents_diff]: ./tools/dir_contents_diff/
226222

227223
Any untriaged failures will block presubmit and postsubmit tests.
228224

engine/src/flutter/impeller/display_list/aiks_dl_atlas_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ TEST_P(AiksTest, DrawAtlasPlusWideGamut) {
176176
ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
177177
}
178178

179-
TEST_P(AiksTest, DlAtlasGeometryNoBlend) {
179+
TEST_P(AiksTest, DlAtlasGeometryNoBlendRenamed) {
180180
auto [texture_coordinates, transforms, atlas] = CreateTestData(this);
181181

182182
DlAtlasGeometry geom(atlas->impeller_texture(), transforms.data(),

engine/src/flutter/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ workspace:
9797
- tools/clangd_check
9898
- tools/compare_goldens
9999
- tools/const_finder
100-
- tools/dir_contents_diff
101100
- tools/engine_tool
102101
- tools/header_guard_check
103102
- tools/gen_web_locale_keymap

engine/src/flutter/testing/impeller_golden_tests_output.txt

Lines changed: 0 additions & 1025 deletions
This file was deleted.

engine/src/flutter/testing/ios_scenario_app/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ resolution: workspace
1414

1515
dependencies:
1616
args: any
17-
dir_contents_diff: any
1817
engine_repo_tools: any
1918
meta: any
2019
path: any

engine/src/flutter/testing/run_tests.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,6 @@ def build_dart_host_test_list():
968968
os.path.join('flutter', 'tools', 'build_bucket_golden_scraper'),
969969
os.path.join('flutter', 'tools', 'clang_tidy'),
970970
os.path.join('flutter', 'tools', 'const_finder'),
971-
os.path.join('flutter', 'tools', 'dir_contents_diff'),
972971
os.path.join('flutter', 'tools', 'engine_tool'),
973972
os.path.join('flutter', 'tools', 'githooks'),
974973
os.path.join('flutter', 'tools', 'header_guard_check'),
@@ -1061,6 +1060,23 @@ def __exit__(self, exception_type, exception_value, exception_traceback):
10611060
os.chdir(self.old_cwd)
10621061

10631062

1063+
def contains_png_recursive(directory):
1064+
"""
1065+
Recursively checks if a directory contains at least one .png file.
1066+
1067+
Args:
1068+
directory: The path to the directory to check.
1069+
1070+
Returns:
1071+
True if a .png file is found, False otherwise.
1072+
"""
1073+
for _, _, files in os.walk(directory):
1074+
for filename in files:
1075+
if filename.lower().endswith('.png'):
1076+
return True
1077+
return False
1078+
1079+
10641080
def run_impeller_golden_tests(build_dir: str, require_skia_gold: bool = False):
10651081
"""
10661082
Executes the impeller golden image tests from in the `variant` build.
@@ -1079,19 +1095,9 @@ def run_impeller_golden_tests(build_dir: str, require_skia_gold: bool = False):
10791095
extra_env.update(vulkan_validation_env(build_dir))
10801096
run_cmd([tests_path, f'--working_dir={temp_dir}'], cwd=build_dir, env=extra_env)
10811097
dart_bin = os.path.join(build_dir, 'dart-sdk', 'bin', 'dart')
1082-
golden_path = os.path.join('testing', 'impeller_golden_tests_output.txt')
1083-
script_path = os.path.join('tools', 'dir_contents_diff', 'bin', 'dir_contents_diff.dart')
1084-
diff_result = subprocess.run(
1085-
f'{dart_bin} {script_path} {golden_path} {temp_dir}',
1086-
check=False,
1087-
shell=True,
1088-
stdout=subprocess.PIPE,
1089-
cwd=os.path.join(BUILDROOT_DIR, 'flutter')
1090-
)
1091-
if diff_result.returncode != 0:
1092-
print_divider('<')
1093-
print(diff_result.stdout.decode())
1094-
raise RuntimeError('impeller_golden_tests diff failure')
1098+
1099+
if not contains_png_recursive(temp_dir):
1100+
raise RuntimeError('impeller_golden_tests diff failure - no PNGs found!')
10951101

10961102
if not require_skia_gold:
10971103
print_divider('<')

engine/src/flutter/tools/dir_contents_diff/README.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

engine/src/flutter/tools/dir_contents_diff/bin/dir_contents_diff.dart

Lines changed: 0 additions & 11 deletions
This file was deleted.

engine/src/flutter/tools/dir_contents_diff/lib/dir_contents_diff.dart

Lines changed: 0 additions & 103 deletions
This file was deleted.

engine/src/flutter/tools/dir_contents_diff/pubspec.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)