Skip to content

Add test to verify that ffigen-generated code is uptodate#180680

Closed
goderbauer wants to merge 1 commit into
flutter:masterfrom
goderbauer:ffigentest
Closed

Add test to verify that ffigen-generated code is uptodate#180680
goderbauer wants to merge 1 commit into
flutter:masterfrom
goderbauer:ffigentest

Conversation

@goderbauer

Copy link
Copy Markdown
Member

No description provided.

@goderbauer goderbauer mentioned this pull request Jan 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a test to verify that the ffigen-generated file is up-to-date. The test works by re-running ffigen and then checking git status to see if the generated file has changed. I've found a critical issue with how the package root path is determined, which will cause the test to fail. My review includes a suggestion to fix this.

});

test('ffigen-generated file is up-to-date', () async {
final String packageRoot = File.fromUri(Platform.script).parent.path;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The packageRoot is not pointing to the actual package root directory. File.fromUri(Platform.script).parent points to the test directory, but ffigen.yaml is located in the parent directory of test. This will cause the ffigen and git commands to fail because they are being executed from the wrong working directory. To fix this, you should navigate one level up in the directory structure to get the correct package root.

Suggested change
final String packageRoot = File.fromUri(Platform.script).parent.path;
final String packageRoot = File.fromUri(Platform.script).parent.parent.path;

@flutter-dashboard

Copy link
Copy Markdown

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@Piinks

Piinks commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Greetings from stale PR triage! 👋
Is this change still on your radar?

@goderbauer

Copy link
Copy Markdown
Member Author

I'll close this for now until I have time to get back to it.

@goderbauer goderbauer closed this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants