-
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
Changes from all commits
cb8b014
2c5f177
12e4808
5f60b15
a7ff3f3
268b7d3
7be3788
f6312e5
8b68a3a
b70e09f
f5d0137
1623f52
79d1010
3dd4d81
984b259
22c9918
1a58dcc
2a26093
9cfee77
dcd7999
e120a3f
83516f0
b704aaf
de881f1
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); | ||
| } |
|
stuartmorgan-g marked this conversation as resolved.
|
| 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.
If this package isn't intended to be run from Windows, you could just not add this here rather than fix the failures.