Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scan] fix misleading error message when no devices are found #21650

Merged

Conversation

MagnificentMiles
Copy link
Contributor

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

Resolves #21598

When using scan with ensure_devices_found: true, the error message doesn't actually display the behavior of scan is using to find the simulator.

scan(
  devices: ["iPhone 14 (16.0)"],
  ensure_devices_found: true,
)

With the above example, the error previously said...

No device found with name 'iPhone 14 (16.4)'

However, scan is actually trying to find a device with a name of "iPhone 14" but using iOS 16.0.

Description

Updated error message when using ensure_devices_found to be more clear on what scan is actually looking for

The above example in the "Motivation and Context" section will now about the following error...

No device found with name 'iPhone 14' with version 16.0

Testing Steps

N/A

@MagnificentMiles
Copy link
Contributor Author

There were no existing tests for this so any suggestions on how to add a test for this would be appreciated 🙏

Copy link
Member

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

I think this is safe as it only touches messages, no functionality logic is changed.

Thanks for fixing this weird behavior 🙏

@rogerluan rogerluan changed the title Fix misleading no devices found error message in scan [scan] fix misleading error message when no devices are found Nov 27, 2023
@rogerluan
Copy link
Member

image

LGTM 👍

@rogerluan rogerluan merged commit d334e2f into fastlane:master Nov 27, 2023
2 checks passed
SubhrajyotiSen pushed a commit to KeepTruckin/fastlane that referenced this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"No device found" error message is misleading.
2 participants