-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[material_ui, cupertino_ui, infra] Support skipping golden files for the design migration #11649
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
base: main
Are you sure you want to change the base?
Changes from all commits
554b2d3
eecf014
83c8701
afd2a5e
6db8d56
b1db62b
c8d5656
71f2016
ca7f637
21461b0
da71cb3
f19d61d
4584c51
94aade5
16f25df
6542c4b
cf69c3a
b4272cd
18d4b8e
e35263c
d6317c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/bash | ||
| # Copyright 2013 The Flutter Authors | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
| set -e | ||
|
|
||
| cd script/flutter_goldens | ||
| flutter analyze --fatal-infos |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/bash | ||
| # Copyright 2013 The Flutter Authors | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
| set -e | ||
|
|
||
| cd script/flutter_goldens | ||
| dart format --set-exit-if-changed . |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/bash | ||
| # Copyright 2013 The Flutter Authors | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
| set -e | ||
|
|
||
| cd script/flutter_goldens | ||
| flutter test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,3 +10,6 @@ git branch main origin/main | |
|
|
||
| cd script/tool | ||
| dart pub get | ||
|
|
||
| cd ../flutter_goldens | ||
| flutter pub get | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:async'; | ||
|
|
||
| import 'goldens_io.dart' | ||
| if (dart.library.js_interop) 'goldens_web.dart' | ||
| as flutter_goldens; | ||
|
|
||
| Future<void> testExecutable(FutureOr<void> Function() testMain) { | ||
| // Enable golden file testing using Skia Gold. | ||
| return flutter_goldens.testExecutable(testMain); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/cupertino.dart'; | ||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
|
|
||
| void main() { | ||
| testWidgets('Inconsequential golden test', (WidgetTester tester) async { | ||
| // The test validates the Flutter Gold integration. Any changes to the | ||
| // golden file can be approved at any time. | ||
| await tester.pumpWidget( | ||
| const CupertinoApp(home: Center(child: Text('Cupertino Goldens'))), | ||
| ); | ||
|
|
||
| await tester.pumpAndSettle(); | ||
| await expectLater( | ||
| find.byType(CupertinoApp), | ||
| matchesGoldenFile('inconsequential_golden_file.png'), | ||
| ); | ||
| }, skip: kIsWeb); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| export 'package:flutter_goldens/flutter_goldens.dart' show testExecutable; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:async'; | ||
|
|
||
| // package:flutter_goldens is not used as part of the test process for web. | ||
| Future<void> testExecutable( | ||
| FutureOr<void> Function() testMain, { | ||
| String? namePrefix, | ||
| }) async => testMain(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| name: material_ui | ||
| description: The official Flutter Material UI Library, implementing Google's Material Design design system. | ||
| version: 0.0.1 | ||
| version: 0.0.2 | ||
| publish_to: none | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call for now. I'll plan to remove this when we are ready to attempt to publish the first pre-release version.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok thanks. Let me double check with Stuart before merging this. |
||
| repository: https://github.com/flutter/packages/tree/main/packages/material_ui | ||
| issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A%20material%20design%22 | ||
|
|
||
|
|
@@ -13,6 +14,8 @@ dependencies: | |
| sdk: flutter | ||
|
|
||
| dev_dependencies: | ||
| flutter_goldens: | ||
| path: ../../script/flutter_goldens | ||
| flutter_test: | ||
| sdk: flutter | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:async'; | ||
|
|
||
| import 'goldens_io.dart' | ||
| if (dart.library.js_interop) 'goldens_web.dart' | ||
| as flutter_goldens; | ||
|
|
||
| Future<void> testExecutable(FutureOr<void> Function() testMain) { | ||
| // Enable golden file testing using Skia Gold. | ||
| return flutter_goldens.testExecutable(testMain); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:material_ui/material_ui.dart'; | ||
|
|
||
| void main() { | ||
| testWidgets('Inconsequential golden test', (WidgetTester tester) async { | ||
| // The test validates the Flutter Gold integration. Any changes to the | ||
| // golden file can be approved at any time. | ||
| await tester.pumpWidget( | ||
| RepaintBoundary(child: Container(color: const Color(0xAFF61145))), | ||
| ); | ||
|
|
||
| await tester.pumpAndSettle(); | ||
| await expectLater( | ||
| find.byType(RepaintBoundary), | ||
| matchesGoldenFile('inconsequential_golden_file.png'), | ||
| ); | ||
| }, skip: kIsWeb); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| export 'package:flutter_goldens/flutter_goldens.dart' show testExecutable; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'dart:async'; | ||
|
|
||
| // package:flutter_goldens is not used as part of the test process for web. | ||
| Future<void> testExecutable( | ||
| FutureOr<void> Function() testMain, { | ||
| String? namePrefix, | ||
| }) async => testMain(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| This package is an internal implementation detail for our testing | ||
| infrastructure. It enables packages to use the Skia Gold | ||
| infrastructure for tracking golden image tests. | ||
|
|
||
| See also: | ||
|  | ||
| * https://skia.org/docs/dev/testing/skiagold/ | ||
| * https://flutter-packages-gold.skia.org/ | ||
| * [Writing a golden file test for package flutter] | ||
|
|
||
| [Writing a golden file test for package flutter]: https://github.com/flutter/flutter/blob/master/docs/contributing/testing/Writing-a-golden-file-test-for-package-flutter.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are any of these file paths that exist in the real packages? Collisions are likely to make the import more difficult, so ideally any placeholders should use different names than real files.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that is intentional. These are not existing file paths so they should not create collisions so that it is easier to merge with the existing mega-migration PR.