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

Create unit and end-to-end tests to test background session logic #404

Open
bhamiltoncx opened this issue Sep 20, 2024 · 0 comments
Open

Comments

@bhamiltoncx
Copy link
Member

Currently, the only tests around APIs like +[GTMSessionFetcher fetcherWithSessionIdentifier:] and +[GTMSessionUploadFetcher uploadFetcherForSessionIdentifier:] are manual tests.

To test the functionality, you have to manually change #define values like these:

#define ENABLE_OUT_OF_PROCESS_DOWNLOAD_TESTING 0

and build, run, kill, and re-launch various test apps.

We should instead:

  1. Create a @protocol to model the session-based logic,
  2. Create a fake implementation for tests, and
  3. Create a real implementation which forwards the UIApplication calls in

This allows writing unit tests for this logic, but we should also make end-to-end tests. For that, we can use XCUITest to install, kill, and restart a test host app.

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

No branches or pull requests

1 participant