Skip to content

Fix: remove cross-import in scaffold_test.dart#183790

Closed
aburiro wants to merge 2 commits into
flutter:masterfrom
aburiro:fix-cross-import-scaffold-test
Closed

Fix: remove cross-import in scaffold_test.dart#183790
aburiro wants to merge 2 commits into
flutter:masterfrom
aburiro:fix-cross-import-scaffold-test

Conversation

@aburiro

@aburiro aburiro commented Mar 17, 2026

Copy link
Copy Markdown

Fixes Part of #182636

This PR removes a cross-import in scaffold_test.dart by duplicating semantics_tester.dart into the material test directory.

This ensures tests do not depend on utilities from other libraries, aligning with the test isolation guidelines.

@google-cla

google-cla Bot commented Mar 17, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) labels Mar 17, 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 resolves a cross-import in scaffold_test.dart by duplicating semantics_tester.dart. While this achieves test isolation, it introduces a large duplicated file, which can be a maintenance concern. I've also found a couple of potential pre-existing bugs in the copied semantics_tester.dart file and have left comments with suggestions to fix them. It would be great to fix them here to avoid propagating them. Also, consider if there's a way to share this test utility without duplication to improve long-term maintainability.

Comment thread packages/flutter/test/material/semantics_tester.dart
Comment thread packages/flutter/test/material/semantics_tester.dart

@navaronbracke navaronbracke 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.

This is probably not the right change to make.

The semantics tester tooling should probably be in flutter_test, if it isn't already.

Besides that, the OP lists an issue as fixed, but that is not the case, since this PR should use "Part of" instead of "Fixes". There's probably more usages that need to be cleaned up.

@chunhtai

Copy link
Copy Markdown
Contributor

TestSemantics is not something we want to make public since it assert the entire semantics tree and can generate a lot of noise. We should move away from this matcher.

I vote for duplicating the code in material for now and file an issue to clean up existing tests.

@justinmc justinmc 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.

I created issue #184367 per @chunhtai's comment above.

This looks good as-is then, but would you be able to include the warnings that I just added in PR #184369 too?

@chunhtai chunhtai 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.

LGTM, once justin's concern is addressed

@justinmc

justinmc commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

@aburiro Are you still available to get this PR ready to land? See my comment above.

github-merge-queue Bot pushed a commit that referenced this pull request Apr 8, 2026
As decided in
#183790 (comment),
we should avoid using TestSemantics. Let's communicate that for now
until we can remove the class entirely.

Part of #184367.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
mbcorona pushed a commit to mbcorona/flutter that referenced this pull request Apr 15, 2026
As decided in
flutter#183790 (comment),
we should avoid using TestSemantics. Let's communicate that for now
until we can remove the class entirely.

Part of flutter#184367.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@victorsanni victorsanni added the CICD Run CI/CD label Apr 20, 2026
@victorsanni victorsanni marked this pull request as draft April 20, 2026 18:07
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 29, 2026
@justinmc justinmc added the waiting for response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 29, 2026
@justinmc justinmc moved this from Todo to In Progress in Test cross-imports Review Queue Apr 29, 2026
@github-actions

Copy link
Copy Markdown

This pull request is being closed because it has not been updated in the last 21 days after a request for more information.

If you are still working on this, please feel free to reopen it or file a new pull request.

Thanks for your contribution.

@github-actions github-actions Bot closed this May 20, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Test cross-imports Review Queue May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. waiting for response The Flutter team cannot make further progress on this issue until the original reporter responds

Projects

Development

Successfully merging this pull request may close these issues.

6 participants