Skip to content

Fix PurchasesIntegrationTest building issue (#996 into main)#998

Merged
vegaro merged 4 commits into
mainfrom
merge-external-pablo-guardiola-pg-fix-purchases-android-integration-tests
May 11, 2023
Merged

Fix PurchasesIntegrationTest building issue (#996 into main)#998
vegaro merged 4 commits into
mainfrom
merge-external-pablo-guardiola-pg-fix-purchases-android-integration-tests

Conversation

@vegaro

@vegaro vegaro commented May 4, 2023

Copy link
Copy Markdown
Member

Merging #996 into main

@vegaro vegaro added the test label May 4, 2023
@vegaro vegaro mentioned this pull request May 4, 2023
@vegaro vegaro changed the title Fix PurchasesIntegrationTest building issue (#996) Fix PurchasesIntegrationTest building issue (#996 into main) May 4, 2023
@vegaro vegaro force-pushed the merge-external-pablo-guardiola-pg-fix-purchases-android-integration-tests branch from 9b02e26 to 28d7b51 Compare May 5, 2023 00:00
@vegaro

vegaro commented May 5, 2023

Copy link
Copy Markdown
Member Author

Not sure what's going on. One of the tests is failing. I don't have access to the Firebase project right now so I can't see what the failure is.

@pablo-guardiola

Copy link
Copy Markdown
Contributor
1 test failed  out of 5

canPurchaseSubsProduct

com.revenuecat.purchases.PurchasesIntegrationTest

java.lang.AssertionError: Verification failed: call 1 of 1: BillingAbstract(#1).makePurchaseAsync(any(), eq(android-integration-test-1683246465943), matcher<PurchasingData>(), null(), null(), eq(false))). Only one matching call to BillingAbstract(#1)/makePurchaseAsync(Activity, String, PurchasingData, ReplaceProductInfo, String, Boolean) happened, but arguments are not matching:
[0]: argument: com.revenuecat.purchases.MainActivity@bcbcf58, matcher: any(), result: +
[1]: argument: android-integration-test-1683246465943, matcher: eq(android-integration-test-1683246465943), result: +
[2]: argument: Subscription(productId=monthly_intro_pricing_one_week, optionId=p1m, productDetails=ProductDetails(#4), token=test-offer-token), matcher: matcher<PurchasingData>(), result: +
[3]: argument: null, matcher: null(), result: +
[4]: argument: null, matcher: null(), result: +
[5]: argument: null, matcher: eq(false), result: -

Stack trace:
                                             io.mockk.impl.InternalPlatform.captureStackTrace                                           (InternalPlatform.kt:125)             
                                               io.mockk.impl.stub.MockKStub.handleInvocation                                            (MockKStub.kt:255)                    
             io.mockk.impl.instantiation.JvmMockFactoryHelper$mockHandler$1.invocation                                                  (JvmMockFactoryHelper.kt:24)          
                               io.mockk.proxy.common.ProxyInvocationHandler.invoke                                                      (ProxyInvocationHandler.kt:36)        
                    com.revenuecat.purchases.common.BillingAbstract_1_Proxy.isConnected                                                 (-:13)                                
                                         com.revenuecat.purchases.Purchases.updatePendingPurchaseQueue$purchases_integrationTestRelease (Purchases.kt:1684)                   
                                         com.revenuecat.purchases.Purchases.onAppForegrounded                                           (Purchases.kt:212)                    
                               com.revenuecat.purchases.AppLifecycleHandler.onStart                                                     (AppLifecycleHandler.kt:11)           
                            androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged                                              (FullLifecycleObserverAdapter.java:39)
                     androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent                                               (LifecycleRegistry.java:360)          
                                       androidx.lifecycle.LifecycleRegistry.addObserver                                                 (LifecycleRegistry.java:202)          
                                       com.revenuecat.purchases.Purchases$1.invoke                                                      (Purchases.kt:164)                    
                                       com.revenuecat.purchases.Purchases$1.invoke                                                      (Purchases.kt:163)                    
                                         com.revenuecat.purchases.Purchases.dispatch                                                    (Purchases.kt:1352)                   
                                         com.revenuecat.purchases.Purchases.<init>                                                      (Purchases.kt:163)                    
                                         com.revenuecat.purchases.Purchases.<init>                                                      (Purchases.kt:84)                     
                                  com.revenuecat.purchases.PurchasesFactory.createPurchases                                             (PurchasesFactory.kt:165)             
                             com.revenuecat.purchases.PurchasesExtensionsKt.configure                                                   (purchasesExtensions.kt:10)           
                  com.revenuecat.purchases.PurchasesIntegrationTest$setup$1.invoke                                                      (PurchasesIntegrationTest.kt:80)      
                  com.revenuecat.purchases.PurchasesIntegrationTest$setup$1.invoke                                                      (PurchasesIntegrationTest.kt:68)      
                          com.revenuecat.purchases.PurchasesIntegrationTest.onActivityReady$lambda-4                                    (PurchasesIntegrationTest.kt:221)     
                          com.revenuecat.purchases.PurchasesIntegrationTest.$r8$lambda$skmKbmN6QaNJDsyjNQYOu78jXxM                      (-:0)                                 
com.revenuecat.purchases.PurchasesIntegrationTest$$ExternalSyntheticLambda1.perform                                                     (-:4)                                 
                                    androidx.test.core.app.ActivityScenario.lambda$onActivity$2$ActivityScenario                        (ActivityScenario.java:660)           
                          androidx.test.core.app.ActivityScenario$$Lambda$4.run                                                         (ActivityScenario.java:652)           
                             java.util.concurrent.Executors$RunnableAdapter.call                                                        (Executors.java:462)                  
                                            java.util.concurrent.FutureTask.run                                                         (FutureTask.java:266)                 
                                   android.app.Instrumentation$SyncRunnable.run                                                         (Instrumentation.java:2223)           
                                                         android.os.Handler.handleCallback                                              (Handler.java:938)                    
                                                         android.os.Handler.dispatchMessage                                             (Handler.java:99)                     
                                                          android.os.Looper.loop                                                        (Looper.java:223)                     
                                                 android.app.ActivityThread.main                                                        (ActivityThread.java:7664)            
                                                   java.lang.reflect.Method.invoke                                                      (Method.java:-2)N                     
                    com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run                                                         (RuntimeInit.java:592)                
                                         com.android.internal.os.ZygoteInit.main                                                        (ZygoteInit.java:947)                 
	at io.mockk.impl.recording.states.VerifyingState.failIfNotPassed(VerifyingState.kt:63)
	at io.mockk.impl.recording.states.VerifyingState.recordingDone(VerifyingState.kt:42)
	at io.mockk.impl.recording.CommonCallRecorder.done(CommonCallRecorder.kt:47)
	at io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:64)
	at io.mockk.impl.eval.VerifyBlockEvaluator.verify(VerifyBlockEvaluator.kt:30)
	at io.mockk.MockKDsl.internalVerify(API.kt:119)
	at io.mockk.MockKKt.verify(MockK.kt:149)
	at io.mockk.MockKKt.verify$default(MockK.kt:140)
	at com.revenuecat.purchases.PurchasesIntegrationTest

@pablo-guardiola

Copy link
Copy Markdown
Contributor

It seems that

is true. Did something change on the backend recently?

@tonidero

tonidero commented May 5, 2023

Copy link
Copy Markdown
Contributor

This was fixed in #980 which was merged just today. If you rebase, this should work

Comment thread integration-tests/build.gradle Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm interesting that R8 is failing with this, maybe we could also try to update to the latest assertj version to see if they fixed it. Haven't found the CHANGELOG though, so might not fix it...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh AS wasn't offering me to upgrade to a more recent version so I assumed this was the latest one, let me try with 3.24.2

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, tried and it still failed 22740ec (#998)

@vegaro vegaro force-pushed the merge-external-pablo-guardiola-pg-fix-purchases-android-integration-tests branch 3 times, most recently from 22740ec to 64a8924 Compare May 6, 2023 00:35
pablo-guardiola and others added 4 commits May 5, 2023 18:48
@vegaro vegaro force-pushed the merge-external-pablo-guardiola-pg-fix-purchases-android-integration-tests branch from 35afc45 to f805f5b Compare May 6, 2023 01:48
@tonidero

tonidero commented May 8, 2023

Copy link
Copy Markdown
Contributor

Lol, github was stuck so I retried a few times 😅

@tonidero

Copy link
Copy Markdown
Contributor

@vegaro Is this ready to merge?

@vegaro vegaro merged commit 94bf412 into main May 11, 2023
@vegaro vegaro deleted the merge-external-pablo-guardiola-pg-fix-purchases-android-integration-tests branch May 11, 2023 17:27
tonidero added a commit that referenced this pull request May 18, 2023
**This is an automatic release.**

### New Features
* CAT-859 Expose whether or not a SubscriptionOption is Prepaid in the
SDK (#1005) via Deema AlShamaa (@dalshamaa)
### Bugfixes
* [CF-1324] Fix personalizedPrice defaulting to false (#952) via beylmk
(@beylmk)
### Performance Improvements
* Store and return ETag last refresh time header (#978) via Toni Rico
(@tonidero)
### Dependency Updates
* Bump fastlane-plugin-revenuecat_internal from `3b03efa` to `fe45299`
(#991) via dependabot[bot] (@dependabot[bot])
* Bump danger from 9.2.0 to 9.3.0 (#981) via dependabot[bot]
(@dependabot[bot])
* Bump fastlane-plugin-revenuecat_internal from `8482a43` to `3b03efa`
(#974) via dependabot[bot] (@dependabot[bot])
* Bump fastlane from 2.212.1 to 2.212.2 (#973) via dependabot[bot]
(@dependabot[bot])
* Bump fastlane-plugin-revenuecat_internal from `9255366` to `8482a43`
(#961) via dependabot[bot] (@dependabot[bot])
### Other Changes
* Add proration modes to post to backend (#977) via swehner (@swehner)
* Added ENTITLEMENTS_COMPUTED_ON_DEVICE (#939) via Cesar de la Vega
(@vegaro)
* Fix flaky test in OfflineCustomerInfoCalculatorTest (#997) via Cesar
de la Vega (@vegaro)
* Fix `OfflineCustomerInfoCalculatorTest` `Unresolved reference:
ProducType` (#995) via Cesar de la Vega (@vegaro)
* Add support for product_plan_identifier for offline customer info
(#959) via Cesar de la Vega (@vegaro)
* Add non-subscriptions support to offline customer info (#958) via
Cesar de la Vega (@vegaro)
* Query only active purchases when generating offline entitlements
customer info (#1003) via Toni Rico (@tonidero)
* Fix `PurchasesIntegrationTest` building issue (#996 into main) (#998)
via Cesar de la Vega (@vegaro)
* Fail offline entitlements computation if product entitlement mapping
not available (#999) via Toni Rico (@tonidero)
* Fix  build_magic_weather lane (#993) via Cesar de la Vega (@vegaro)
* Add backend integration tests and test product entitlement mapping
endpoint (#988) via Toni Rico (@tonidero)
* Fix purchases integration tests (#980) via Toni Rico (@tonidero)
* Disable offline entitlements if active inapp purchases exist (#983)
via Toni Rico (@tonidero)
* Clear cached customer info upon entering offline entitlements mode
(#989) via Toni Rico (@tonidero)
* Update product entitlement mapping request to new format (#976) via
Toni Rico (@tonidero)
* Support enabling/disabling offline entitlements (#964) via Toni Rico
(@tonidero)
* Add back integration tests automation (#972) via Toni Rico (@tonidero)
* Upgrade to AGP 8.0 (#975) via Toni Rico (@tonidero)
* Extract post receipt logic to PostReceiptHelper (#967) via Toni Rico
(@tonidero)
* Add isServerDown to error callback for postReceipt and getCustomerInfo
requests (#963) via Toni Rico (@tonidero)
* Add back integration test flavors (#962) via Toni Rico (@tonidero)
* Fix storing test results (#966) via Cesar de la Vega (@vegaro)
* Extract detekt job from test job (#965) via Cesar de la Vega (@vegaro)


[CF-1324]:
https://revenuecats.atlassian.net/browse/CF-1324?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
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

Successfully merging this pull request may close these issues.

3 participants