Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[url_launcher_ios] Backfill unit tests #7123

Closed
wants to merge 3 commits into from

Conversation

Serdnad
Copy link

@Serdnad Serdnad commented Feb 8, 2023

Backfills basic unit tests for the url_launcher iOS plugin, in preparation of migrating the plugin to Swift (flutter/flutter#119102).

Ticket: flutter/flutter#119102

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@Serdnad
Copy link
Author

Serdnad commented Feb 8, 2023

Both iOS native testing and Objective-C are admittedly out of my familiarity zone, so please let me know if there's a better way to test the plugin. I'm also pretty sure these tests can be made more thorough using POP and a mock class or two, during the Swift migration.

@Serdnad Serdnad mentioned this pull request Feb 8, 2023
11 tasks
@Serdnad Serdnad force-pushed the swift-url-launcher-tests branch from b7cd9fb to 3e0d790 Compare February 8, 2023 07:30
@hellohuanlin
Copy link
Contributor

I'm also pretty sure these tests can be made more thorough using POP and a mock class or two, during the Swift migration.

It is important to get full coverage BEFORE the migration, so that the contributors/reviewers are fully aware of what the existing behavior is (and with bonus point to discover new bugs).

You can follow this to get a test coverage report in Xcode. To be clear, this coverage report is just a tool, not a metric - we need to actually read the test and decide whether we have full coverage.

If we can get good coverage without using OCMock, then just writing Swift test is fine. But if we need OCMock, then we may have to do the backfill in ObjC first due to OCMock limitation discussed here.

@jmagman jmagman requested a review from hellohuanlin February 9, 2023 02:21
@jmagman
Copy link
Member

jmagman commented Feb 9, 2023

Code coverage before this PR:

Screenshot 2023-02-08 at 6 28 51 PM

And on this PR:
Screenshot 2023-02-08 at 6 26 47 PM

@stuartmorgan-g
Copy link
Contributor

We've just completed the migration of the plugin code to the flutter/packages repository, as described in https://flutter.dev/go/flutter-plugins-repo-migration, and this repository is now being archived. Unfortunately that means that all in-progress PRs here must be moved to flutter/packages.

Please see our instructions for an explanation of how to move your PR, and if you have any issues moving your PR please don't hesitate to reach out in the #hackers-ecosystem channel in Discord.

Our apologies that your PR was caught in this one-time transition. We're aware that it's disruptive in the short term, and appreciate your help in getting us to a better long-term state!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants