Test wrapper pass-through calls - #1010
Merged
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 24, 2026
vegaro
force-pushed
the
cesar/unity-edit-mode-test-infra
branch
from
July 24, 2026 16:03
75760bd to
3ded913
Compare
vegaro
force-pushed
the
cesar/unity-wrapper-passthrough-tests
branch
from
July 24, 2026 16:03
fdec4bb to
cf84e49
Compare
vegaro
force-pushed
the
cesar/unity-wrapper-passthrough-tests
branch
from
July 27, 2026 08:57
cf84e49 to
235bd5c
Compare
vegaro
force-pushed
the
cesar/unity-edit-mode-test-infra
branch
2 times, most recently
from
July 27, 2026 09:00
62ef6c4 to
98db931
Compare
vegaro
force-pushed
the
cesar/unity-wrapper-passthrough-tests
branch
2 times, most recently
from
July 27, 2026 10:15
1e25542 to
d666319
Compare
vegaro
force-pushed
the
cesar/unity-edit-mode-test-infra
branch
from
July 27, 2026 10:15
98db931 to
c91fc0a
Compare
vegaro
force-pushed
the
cesar/unity-wrapper-passthrough-tests
branch
from
July 27, 2026 10:20
d666319 to
f461972
Compare
vegaro
force-pushed
the
cesar/unity-edit-mode-test-infra
branch
from
July 27, 2026 10:20
c91fc0a to
a45f0a2
Compare
vegaro
added a commit
that referenced
this pull request
Jul 27, 2026
This one's pure harness/CI plumbing, no test content, so it's a small. Adds the `RevenueCat.Tests.EditMode` assembly, `PurchasesWrapperSpy`, and an internal `SetWrapper` hook (via `InternalsVisibleTo`) so tests can inject the spy into `Purchases`. Wires a `test-edit-mode` CircleCI job that imports the packaged SDK and runs the suite the same way CI already exercises the API tests. Stacked on top, each independent of the others: - #1014 configuration and harness smoke tests - #1010 wrapper pass-through tests - #1011 purchase forwarding & result parsing - #1012 single-request callback flows - #1013 tracking + model tests <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are test/CI infrastructure plus a small internal injection hook on `Purchases`; no production purchase or auth behavior changes for shipped apps. > > **Overview** > Adds **Unity Edit Mode test plumbing** so later PRs can assert `Purchases` behavior against the **exported** `Purchases.unitypackage` / `PurchasesUI.unitypackage`. > > Introduces the Editor-only `RevenueCat.Tests.EditMode` assembly and a **`PurchasesWrapperSpy`** that records every `IPurchasesWrapper` call. **`Purchases.SetWrapper`** (internal, exposed via `InternalsVisibleTo` on the SDK assembly) lets tests inject the spy and keeps **`AdTracker`** wired to the same wrapper; platform `Start()` now goes through `SetWrapper` instead of assigning `_wrapper` directly. > > **CircleCI** broadens the pre-import “hide scripts” step to `Assets/Tests` (`.cs` and `.asmdef`), adds a **`test-edit-mode`** job (`unity/test` editmode after `import-package`), stores JUnit artifacts, and gates the release **hold** on that job. **IntegrationTests README** documents running Edit Mode tests locally via Test Runner. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a45f0a2. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
vegaro
force-pushed
the
cesar/unity-wrapper-passthrough-tests
branch
from
July 27, 2026 12:19
f461972 to
35cc4dc
Compare
Adds WrapperPassthroughTests.cs covering message display, locale override, cache invalidation, attribute setters, AppsFlyer conversion data, and Amazon purchase sync forwarding.
vegaro
force-pushed
the
cesar/unity-wrapper-passthrough-tests
branch
from
July 28, 2026 14:01
35cc4dc to
3b5a14e
Compare
vegaro
marked this pull request as ready for review
July 28, 2026 14:04
rickvdl
approved these changes
Jul 28, 2026
rickvdl
left a comment
Member
There was a problem hiding this comment.
Nice 🙌 !
Question: are we planning on adding all APIs to this list? For example there is still SetLogLevel and SetLogHandler and a bunch of attribution APIs.
| Assert.That(conversionData["click_count"].AsInt, Is.EqualTo(3)); | ||
| Assert.That(conversionData["nested"]["key"].Value, Is.EqualTo("value")); | ||
| Assert.That(conversionData["list"][0].Value, Is.EqualTo("a")); | ||
| Assert.That(conversionData["list"][1].Value, Is.EqualTo("b")); |
Member
There was a problem hiding this comment.
Should we add other data type examples here as well? Bool / long / float / double
Member
Author
|
@rickvdl I am going to do a follow up PR since this one is approved already 😄 |
vegaro
enabled auto-merge (squash)
July 29, 2026 08:00
vegaro
added a commit
that referenced
this pull request
Jul 29, 2026
Extends the pass-through suite in response to review feedback on #1010. SetAppsFlyerConversionData now exercises bool, long, float and double in addition to string/null/int/nested/list. The numeric assertions read the value back through AsLong/AsFloat/AsDouble rather than comparing the serialized text, because SimpleJSON routes every number through a double field and writes it with ToString(InvariantCulture) - a float given as 9.99f serializes as 9.989999771118164. Three raw-JSON substring checks pin the wire text the natives actually re-parse: unquoted lowercase true/false and an un-exponentiated long. Adds coverage for the logging and sync entry points (SetLogLevel, SetLogHandler, SetDebugLogsEnabled, SetAllowSharingStoreAccount, SyncPurchases, SyncAttributesAndOfferingsIfNeeded, PresentCodeRedemptionSheet, EnableAdServicesAttributionTokenCollection), the synchronous getters, TrackCustomPaywallImpression, and the five AdTracker.TrackAd* methods. The twenty string attribution setters move into a new AttributionPassthroughTests fixture, driven by one TestCaseSource that carries the wrapper method name, the call and the expected value on a single entry, so a setter cannot be added to the list without also getting asserted. SetAdjustID moves in from the old fixture. SetProxyURL is left untested: it has no public facade, and its only call site replaces the injected wrapper with a real one.
vegaro
added a commit
that referenced
this pull request
Jul 29, 2026
Extends the pass-through suite in response to review feedback on #1010. SetAppsFlyerConversionData now exercises bool, long, float and double in addition to string/null/int/nested/list. The numeric assertions read the value back through AsLong/AsFloat/AsDouble rather than comparing the serialized text, because SimpleJSON routes every number through a double field and writes it with ToString(InvariantCulture) - a float given as 9.99f serializes as 9.989999771118164. Three raw-JSON substring checks pin the wire text the natives actually re-parse: unquoted lowercase true/false and an un-exponentiated long. Adds coverage for the logging and sync entry points (SetLogLevel, SetLogHandler, SetDebugLogsEnabled, SetAllowSharingStoreAccount, SyncPurchases, SyncAttributesAndOfferingsIfNeeded, PresentCodeRedemptionSheet, EnableAdServicesAttributionTokenCollection), the synchronous getters, TrackCustomPaywallImpression, and the five AdTracker.TrackAd* methods. The twenty string attribution setters move into a new AttributionPassthroughTests fixture, driven by one TestCaseSource that carries the wrapper method name, the call and the expected value on a single entry, so a setter cannot be added to the list without also getting asserted. SetAdjustID moves in from the old fixture. SetProxyURL is left untested: it has no public facade, and its only call site replaces the injected wrapper with a real one.
This was referenced Jul 29, 2026
RCGitBot
added a commit
that referenced
this pull request
Jul 30, 2026
**This is an automatic release.** ## RevenueCat SDK ### ✨ New Features * feat(paywalls): Add PaywallListener support to presented paywalls (SDK-4397) (#1001) via Toni Rico (@tonidero) ### 📦 Dependency Updates * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 18.27.0 (#1026) via RevenueCat Git Bot (@RCGitBot) * [Android 10.15.1](https://github.com/RevenueCat/purchases-android/releases/tag/10.15.1) * [iOS 5.82.0](https://github.com/RevenueCat/purchases-ios/releases/tag/5.82.0) * [iOS 5.81.3](https://github.com/RevenueCat/purchases-ios/releases/tag/5.81.3) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 18.26.0 (#1021) via RevenueCat Git Bot (@RCGitBot) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 18.25.0 (#1015) via RevenueCat Git Bot (@RCGitBot) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 18.24.0 (#1007) via RevenueCat Git Bot (@RCGitBot) ### 🔄 Other Changes * Test wrapper pass-through calls (#1010) via Cesar de la Vega (@vegaro) * Add configuration and harness smoke tests (#1014) via Cesar de la Vega (@vegaro) * Add IOSPaywallPresentationStyle.FormSheet for iPad paywall presentation (#995) via Facundo Menzella (@facumenzella) * Bump fastlane-plugin-revenuecat_internal from `d392939` to `3421c88` (#1017) via dependabot[bot] (@dependabot[bot]) * Add Unity Edit Mode test harness and CI job (#1009) via Cesar de la Vega (@vegaro) * Use mise lockfile and install-mise-tools in CI (#997) via Álvaro Brey (@AlvaroBrey) * Bump json from 2.15.2.1 to 2.19.9 in /IntegrationTests (#1005) via dependabot[bot] (@dependabot[bot]) * Bump fastlane-plugin-revenuecat_internal from `b52fca5` to `d392939` (#1004) via dependabot[bot] (@dependabot[bot]) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > The diff only updates version strings and changelogs; no new SDK logic here. Underlying feature and dependency changes were merged separately and are documented in CHANGELOG. > > **Overview** > This PR is an **automatic release** that ships **9.6.0** by bumping version metadata everywhere it must stay aligned: `.version`, `RevenueCat/package.json`, `RevenueCatUI/package.json`, `VERSIONS.md`, and the reported plugin version in `PurchasesWrapper.java` and `PurchasesUnityHelper.m`. > > The **changelog** for 9.6.0 documents what landed since 9.5.3—not new code in this diff. Highlights for reviewers: **PaywallListener** on presented paywalls, **purchases-hybrid-common 18.27.0** (Android 10.15.1, iOS 5.82.0), **FormSheet** iPad paywall presentation style, plus CI/test harness work (Edit Mode tests, mise lockfile, wrapper pass-through tests). > > **Risk:** Low for this PR itself—it is versioning and release notes; runtime behavior changes come from the dependency bumps and features already merged on the release branch. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d8e79d2. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
vegaro
added a commit
that referenced
this pull request
Aug 6, 2026
Extends the pass-through suite in response to review feedback on #1010. SetAppsFlyerConversionData now exercises bool, long, float and double in addition to string/null/int/nested/list. The numeric assertions read the value back through AsLong/AsFloat/AsDouble rather than comparing the serialized text, because SimpleJSON routes every number through a double field and writes it with ToString(InvariantCulture) - a float given as 9.99f serializes as 9.989999771118164. Three raw-JSON substring checks pin the wire text the natives actually re-parse: unquoted lowercase true/false and an un-exponentiated long. Adds coverage for the logging and sync entry points (SetLogLevel, SetLogHandler, SetDebugLogsEnabled, SetAllowSharingStoreAccount, SyncPurchases, SyncAttributesAndOfferingsIfNeeded, PresentCodeRedemptionSheet, EnableAdServicesAttributionTokenCollection), the synchronous getters, TrackCustomPaywallImpression, and the five AdTracker.TrackAd* methods. The twenty string attribution setters move into a new AttributionPassthroughTests fixture, driven by one TestCaseSource that carries the wrapper method name, the call and the expected value on a single entry, so a setter cannot be added to the list without also getting asserted. SetAdjustID moves in from the old fixture. SetProxyURL is left untested: it has no public facade, and its only call site replaces the injected wrapper with a real one.
vegaro
added a commit
that referenced
this pull request
Aug 28, 2026
…1022) Follow-up to #1010 for @rickvdl two comments <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Test-only changes with no production SDK behavior modified. > > **Overview** > **Expands Edit Mode integration coverage** so the `Purchases` facade reliably delegates to `IPurchasesWrapper` without reshaping arguments. > > Adds **`AttributionPassthroughTests`**, a parameterized suite that asserts every string attribution/subscriber-attribute setter (email, MMP IDs, campaign fields, etc.) forwards the exact value to the matching wrapper method, plus a dedicated case that **`null` is not stripped** (attribute deletion). > > **`WrapperPassthroughTests`** gains passthrough checks for logging (`SetLogLevel`, deprecated debug/account flags), sync and cache helpers, log handler, code redemption, Ad Services attribution, identity/configuration getters, and cached virtual currencies; **`SetAdjustID`** coverage moves out of this file into the attribution suite. The AppsFlyer conversion-data test now asserts **typed JSON** (bools, longs, floats/doubles) and raw JSON fragments, not only strings and nested structures. > > **`TrackingTests`** tightens custom paywall impression tracking by asserting the **same** `CustomPaywallImpressionParams` instance is passed through to the wrapper. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b7617a5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Part of the #1006 split, stacked on #1009.
Adds
WrapperPassthroughTests.cs: message display, locale override, cache invalidation, attribute setters, AppsFlyer conversion data, and Amazon purchase sync forwarding.Note
Low Risk
Test-only additions with no production code changes; low regression risk beyond test maintenance.
Overview
Adds
WrapperPassthroughTestsEditMode coverage that wiresPurchasestoPurchasesWrapperSpyand asserts selected public APIs delegate toIPurchasesWrapperwith the right arguments.Tests cover attribute JSON (strings and nulls), in-app messages (array reference vs null default), UI locale override, customer info / virtual currencies cache invalidation, AppsFlyer conversion data JSON (nested dicts and lists), Amazon purchase sync argument order, device identifier collection, Ask to Buy sandbox simulation, and Adjust ID forwarding.
Reviewed by Cursor Bugbot for commit bb5766d. Bugbot is set up for automated code reviews on this repo. Configure here.