facebook / buck

A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.
https://buck.build
Apache License 2.0
8.56k stars 1.16k forks source link

Android App Bundles - Add test cases for dynamic feature modules #2609

Closed uKetki closed 3 years ago

uKetki commented 3 years ago

Added test cases and prepared test data for dynamic feature module. Each feature has distinctly unique characteristics explained as follows:

kotlin -> Feature written in Kotlin and will be available on-demand java -> Feature written in Java and will be available conditionally at install-time for devices with minsdk=21 and maxSdk=24 native -> Feature written in Java using JNI and will be available on-demand initialInstall -> Feature written in Java and will be available at install-time

Depends on #2586

uKetki commented 3 years ago

All test cases are failing due to the below error. However, if I don't see this issue locally and test cases are working as expected. Are there any changes required either on CI or from code to support this use case?

stderr: /home/circleci/buck/test/com/facebook/buck/android/AndroidAppBundleIntegrationTest.java:41: error: cannot find symbol
import com.facebook.buck.util.MoreStringsForTests;
                             ^
  symbol:   class MoreStringsForTests
  location: package com.facebook.buck.util
Errors: 1. Warnings: 0.

    When running <source_abi>.
    When building rule //test/com/facebook/buck/android:app-bundle-integration#source-abi,testsjar.
KapJI commented 3 years ago

@uKetki you probably need to update BUCK file and add new dependency there.

uKetki commented 3 years ago

@uKetki you probably need to update BUCK file and add new dependency there.

Thanks, @KapJI. Added dependency for //test/com/facebook/buck/util:testutil in app-bundle-integration test.

KapJI commented 3 years ago

NDK 17 failed tests look relevant.

uKetki commented 3 years ago

NDK 17 failed tests look relevant. Do I need to include kotlin_home in a different way?

Overridden kotlin:kotlin_home path not found: kotlinc
When creating rule //kotlin/com/sample/dynamic_features/on_demand:src_release.
uKetki commented 3 years ago

Setup kotlinc path in the test workspace. The current failed cases seem unrelated.

TESTS FAILED: 1 FAILURE
Failed target: //test/com/facebook/buck/rules/modern/builders:builders
FAIL com.facebook.buck.rules.modern.builders.HybridLocalStrategyTest
uKetki commented 3 years ago

Thanks! 🎉

Thanks for merging the PR, @KapJI!