Skip to content

Add execution tests for ApolloClient clearCache callback queue#1901

Merged
calvincestari merged 2 commits intomainfrom
issue/1900-tests
Aug 11, 2021
Merged

Add execution tests for ApolloClient clearCache callback queue#1901
calvincestari merged 2 commits intomainfrom
issue/1900-tests

Conversation

@calvincestari
Copy link
Copy Markdown
Member

@calvincestari calvincestari commented Aug 11, 2021

This introduces new tests to verify the callbacks on clearCache are being used as expected.

It is difficult to verify which queue is active through the DispatchQueue API so the test uses setSpecific/getSpecific to associate a key/value with the queue and validate in the completion callback - thanks for the tip @designatednerd.

@calvincestari
Copy link
Copy Markdown
Member Author

Note: It is expected that testCacheClearCompletion_givenCustomCallbackQueue_shouldCallbackOnCustomQueue will fail in this PR until the fix is submitted.

--

Failures as expected:

@calvincestari calvincestari added 2021-08 no-changelog Indicates that changes from this PR do not need to be included in the changelog for their release. labels Aug 11, 2021
@calvincestari calvincestari merged commit b6bfea0 into main Aug 11, 2021
@calvincestari calvincestari deleted the issue/1900-tests branch August 11, 2021 20:10
ketenshi added a commit to scorebet/apollo-ios that referenced this pull request Aug 16, 2021
* main: (856 commits)
  Add execution tests for ApolloClient clearCache callback queue (apollographql#1901)
  Use the provided callback queue instead of the store's default. (apollographql#1904)
  chore(deps): update dependency path-parse to 1.0.7 [security] (apollographql#1899)
  Release - 0.46.0 (apollographql#1897)
  Update subscriptions tutorial to be compatible with recent changes (apollographql#1893)
  Add docs and improve merging of records from WebSockets into cache. (apollographql#1892)
  Publish response from the `WebSocketTransport` to the `ApolloStore` (apollographql#1889)
  fix(deps): update dependency gatsby-theme-apollo-docs to v4.7.14
  Removing Swift codegen (v1) (apollographql#1873)
  Update toolchain versions used by circleci (apollographql#1875)
  fix(deps): update dependency gatsby-theme-apollo-docs to v4.7.13
  Community Updates - ROADMAP/README (apollographql#1867)
  [Release] - 0.45.0 (apollographql#1862)
  WebSocket Fixes - Revert to Starscream 3.x and invert dependency (apollographql#1861)
  Docs/discussions_2_community branch changes (apollographql#1858)
  Replace spectrum with Discourse (apollographql#1857)
  fix(deps): update dependency gatsby-theme-apollo-docs to v4.7.12
  Configure Renovate (apollographql#1854)
  Revert "Reconfiguring renovate 2/2"
  Reconfiguring renovate 2/2
  ...

# Conflicts:
#	Sources/Apollo/GraphQLQueryWatcher.swift
#	Sources/ApolloWebSocket/WebSocketTransport.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that changes from this PR do not need to be included in the changelog for their release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants