Skip to content

Add back integration test flavors#962

Merged
tonidero merged 2 commits into
mainfrom
add-back-integration-test-flavors
Apr 14, 2023
Merged

Add back integration test flavors#962
tonidero merged 2 commits into
mainfrom
add-back-integration-test-flavors

Conversation

@tonidero

@tonidero tonidero commented Apr 11, 2023

Copy link
Copy Markdown
Contributor

Description

We detected that the chnages to support the new integration tests caused compilation issues for top-level kotlin functions. After debugging the issue, we tracked the issue down to this block of code:

    productFlavors {
        integrationTest {
            .....
            packagingOptions {
                resources.excludes.add("META-INF/*")
            }
        }
    }

We assumed that the packagingOptions there would only affect the integrationTest flavor, but it actually affects other flavors as well. This was causing a kotlin_module file to not be included in the published aar file, which caused top level functions to not be accessible by library consumers.
In this PR we change the exclusion to only exclude the files that were duplicated during instrumentation tests: META-INF/LICENSE.md and META-INF/LICENSE-notice.md.
Comparing the resulting AAR's:

  • In 5.8.2: We had a META-INF/purchases_latestDependenciesRelease.kotlin_module file.
  • In 6.1.0 (the faulty version): We didn't have any kotlin_module files
  • In 6.1.1: We had a META_INF/purchases_release.kotlin_module file.
  • After this fix: We have a META_INF/purchases_defaultsRelease.kotlin_module file.

Also, testing this change (by deploying to local maven and using it in a project) we can confirm the issue appears in 6.1.0 and before this change but doesn't appear after this change.

TODO

  • Add tests that check against the resulting aar instead of using the modules to make sure this doesn't happen again. Added task SDK-3062 to track this

@tonidero tonidero added the test label Apr 11, 2023
Comment thread purchases/build.gradle
testBuildType obtainTestBuildType()
packagingOptions {
resources.excludes.add("META-INF/LICENSE.md")
resources.excludes.add("META-INF/LICENSE-notice.md")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the main change from before. Before we were excluding META-INF/*. Now, we are excluding these files that were causing the duplicated files (due to Junit library in instrumentation tests). I tried to exclude this only on instrumentation tests but there was no easy way... And I think this should be safe enough.

@tonidero tonidero marked this pull request as ready for review April 13, 2023 07:57
@tonidero tonidero requested a review from a team April 13, 2023 07:57
@tonidero tonidero merged commit 8820c61 into main Apr 14, 2023
@tonidero tonidero deleted the add-back-integration-test-flavors branch April 14, 2023 08:38
tonidero added a commit that referenced this pull request Apr 21, 2023
### Description
We added the integration tests flavor back in #962, but we didn't bring
back the CircleCI automations. Also, since unit tests are taking twice
as long after adding this flavor, we are making CircleCI unit tests run
only on the `defaults` flavor.
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.

2 participants