Fix a misuse of matchesGoldenFile() in the physical_model_test.#30141
Merged
2 commits merged intomasterfrom Mar 29, 2019
unknown repository
Merged
Fix a misuse of matchesGoldenFile() in the physical_model_test.#301412 commits merged intomasterfrom unknown repository
2 commits merged intomasterfrom
unknown repository
Conversation
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When running the flutter tests with a clean tree on my Mac, I hit the following report:
Which is weird as it reported that All tests passed! even though there was an exception thrown. Looking into the issue, the exception appears to be caused by a golden file test that was not being called inside
await expectLater. So when the exception failed on my machine, it was after the test completed so didn't count as a test failure.In addition, it appears this golden image doesn't match the rendering for it on the Mac, so I added a skip for this check on anything but Linux.
I manually checked all the other usages of
matchesGoldenFileand didn't see any other instances where it was used incorrectly. However, would it might make sense to provide aexpectGoldenMatch(finder, goldenFileName)that handles the synchronization (and optionally skips non-Linux platforms) to avoid this kind of issue in the future?Related Issues
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.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?