Skip to content

Conversation

@Piinks
Copy link
Contributor

@Piinks Piinks commented Jun 4, 2019

Description

This PR adds the optional version parameter to the matchesGoldenFile function. This is not a breaking change, and maintains testing fidelity with flutter/goldens.
The reason for this change is the forthcoming integration of Skia Gold for golden file testing (#33688). This establishes a clean, uniform naming structure for golden file tests, that will work in both systems, past and future, during the interim.

Documentation of this change needs to be done before landing, but not until changes are approved.

Related Issues

Dependent on: #33865
Fixes #33813

Tests

I added the following tests:

  • Comparator succeeds incorporating version number
  • Comparator succeeds with null version number
  • Comparator failure incorporates version number
  • Comparator failure with null version number

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@Piinks Piinks added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Jun 4, 2019
@Piinks Piinks mentioned this pull request Jun 4, 2019
9 tasks
key
.toString()
.splitMapJoin(
RegExp(r'.png'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know that these will always be .png? What about using the path packages to just split off any extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we do the binding for a golden test, we have it write out in png format. See here:

final ByteData bytes = await image.toByteData(format: ui.ImageByteFormat.png);

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Piinks Piinks merged commit 7d95e8e into flutter:master Jun 18, 2019
@Piinks Piinks deleted the goldenVersions branch July 9, 2019 17:08
johnsonmh pushed a commit to johnsonmh/flutter that referenced this pull request Jul 30, 2019
…ile (flutter#33880)

* Splitting golden file versioning out as an argument of matchesGoldenFile

* Fixing description implementation.

* Removing unused imports

* Removing unused import

* Review feedback
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New versioning structure for golden file testing

3 participants