Skip to content

run_ios_tests: Allow running from any directory - #190822

Merged
cbracken merged 1 commit into
flutter:masterfrom
cbracken:run-scenario-tests-from-any-dir
Aug 11, 2026
Merged

run_ios_tests: Allow running from any directory#190822
cbracken merged 1 commit into
flutter:masterfrom
cbracken:run-scenario-tests-from-any-dir

Conversation

@cbracken

Copy link
Copy Markdown
Member

Previously run_ios_tests.sh only worked when invoked from engine/src/flutter which, to be fair, is what the READMEs tell you to do but there's no reason we need to force that, and we don't for other tests like run_tests.py. This is mostly just post-monorepo-merge cleanup.

Two separate things depended on the working directory:

  • The wrapper was resolving SCRIPT_DIR from BASH_SOURCE but still passed the Dart entrypoint as a relative path, so the VM would report No such file or directory.
  • run_ios_tests.dart called Engine.tryFindWithin(), which defaults to the current directory and only walks upward. From the repo root engine/src is below the starting point, so the search fails and the script exits with Must be run from within the engine repository.

Both now resolve from the script's own location, so the documented invocation keeps working and but invoking from any other directory works too. The Dart side matches the existing usage in
tools/header_guard_check/lib/header_guard_check.dart:162.

Also fixed up the READMEs, which had a few other issues... one if which was that I forgot to update them in #190818.

No test changes because this is test changes.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Previously `run_ios_tests.sh` only worked when invoked from
`engine/src/flutter` which, to be fair, is what the READMEs tell you to
do but there's no reason we need to force that, and we don't for other
tests like run_tests.py. This is mostly just post-monorepo-merge
cleanup.
Two separate things depended on the working directory:
* The wrapper was resolving `SCRIPT_DIR` from `BASH_SOURCE` but still
passed the Dart entrypoint as a relative path, so the VM would report
`No such file or directory`.
* `run_ios_tests.dart` called `Engine.tryFindWithin()`, which defaults to
the current directory and only walks upward. From the repo root
`engine/src` is below the starting point, so the search fails and the
script exits with `Must be run from within the engine repository.`
Both now resolve from the script's own location, so the documented
invocation keeps working and but invoking from any other directory works
too. The Dart side matches the existing usage in
`tools/header_guard_check/lib/header_guard_check.dart:162`.
Also fixed up the READMEs, which had a few other issues... one if which
was that I forgot to update them in flutter#190818.
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actionsgithub-actionsBot added engine flutter/engine related. See also e: labels. team-engine Owned by Engine team d: docs/ flutter/flutter/docs, for contributors labels Aug 10, 2026

@gemini-code-assistgemini-code-assistBot 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 updates the iOS scenario app testing scripts and documentation to allow running the tests from any directory. Specifically, 'run_ios_tests.dart' now searches for the engine repository starting from its own script location rather than the current working directory, and 'run_ios_tests.sh' uses the script's directory to locate the Dart entry point. Additionally, related documentation and paths in 'README.md' files are updated to reflect these changes and the transition from 'AppDelegate' to 'SceneDelegate' for scenario arguments. There are no review comments, so no further feedback is provided.

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

thanks for fixing the readme files too

@cbracken
cbracken added this pull request to the merge queueAug 10, 2026
Merged via the queue into flutter:master with commit a57db01Aug 11, 2026
21 of 22 checks passed
@cbracken
cbracken deleted the run-scenario-tests-from-any-dir branch August 11, 2026 00:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICDRun CI/CDd: docs/flutter/flutter/docs, for contributorsengineflutter/engine related. See also e: labels.team-engineOwned by Engine team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@cbracken@hellohuanlin