From e35ebe90bd79cf0273c6378f221d8cb00c6a4d5e Mon Sep 17 00:00:00 2001 From: Max Albright Date: Fri, 3 Jan 2025 13:41:08 -0800 Subject: [PATCH] Ignore some tests on github actions Summary: Removed tests from github action Reviewed By: jjiang10 Differential Revision: D67778333 fbshipit-source-id: 583e955bb846b5a97dbdbb0e158dd0d0c1b070b0 --- facebook-core/build.gradle.kts | 181 +++++++++++++++++---------------- 1 file changed, 92 insertions(+), 89 deletions(-) diff --git a/facebook-core/build.gradle.kts b/facebook-core/build.gradle.kts index 2bee472ee8..e9ac129e76 100644 --- a/facebook-core/build.gradle.kts +++ b/facebook-core/build.gradle.kts @@ -7,8 +7,8 @@ */ plugins { - id("com.android.library") - id("kotlin-android") + id("com.android.library") + id("kotlin-android") } group = "com.facebook.android" @@ -22,105 +22,108 @@ extra["description"] = "Facebook Core Android SDK" extra["url"] = "https://github.com/facebook/facebook-android-sdk" dependencies { - api(project(":facebook-bolts")) - - // Support Dependencies - implementation(Libs.androidx_annotation) - implementation(Libs.androidx_legacy_support_core_utils) - - implementation(Libs.android_installreferrer) - implementation(Libs.androidx_core_ktx) - implementation(Libs.kotlin_stdlib) - - // Unit Tests - testImplementation(project(":facebook-testutil")) - testImplementation(Libs.junit) - testImplementation(Libs.robolectric) - testImplementation(Libs.androidx_test_core) - - testImplementation(Libs.mockito_inline) - testImplementation(Libs.mockito_kotlin) - - testImplementation(Libs.powermock_core) - testImplementation(Libs.powermock_api_mockito2) - testImplementation(Libs.powermock_junit4) - testImplementation(Libs.powermock_junit4_rule) - testImplementation(Libs.powermock_classloading_xstream) - testImplementation(Libs.assertj_core) - - testImplementation(Libs.mockwebserver) - - testImplementation(Libs.android_installreferrer) - testImplementation(Libs.kotlin_stdlib) - testImplementation(Libs.kotlin_test_junit) - testImplementation(Libs.play_services_gcm) + api(project(":facebook-bolts")) + + // Support Dependencies + implementation(Libs.androidx_annotation) + implementation(Libs.androidx_legacy_support_core_utils) + + implementation(Libs.android_installreferrer) + implementation(Libs.androidx_core_ktx) + implementation(Libs.kotlin_stdlib) + + // Unit Tests + testImplementation(project(":facebook-testutil")) + testImplementation(Libs.junit) + testImplementation(Libs.robolectric) + testImplementation(Libs.androidx_test_core) + + testImplementation(Libs.mockito_inline) + testImplementation(Libs.mockito_kotlin) + + testImplementation(Libs.powermock_core) + testImplementation(Libs.powermock_api_mockito2) + testImplementation(Libs.powermock_junit4) + testImplementation(Libs.powermock_junit4_rule) + testImplementation(Libs.powermock_classloading_xstream) + testImplementation(Libs.assertj_core) + + testImplementation(Libs.mockwebserver) + + testImplementation(Libs.android_installreferrer) + testImplementation(Libs.kotlin_stdlib) + testImplementation(Libs.kotlin_test_junit) + testImplementation(Libs.play_services_gcm) } android { - compileSdkVersion(Config.compileSdk) - // The version of Jacoco used by the android gradle plugin - jacoco { version = "0.8.7" } - - defaultConfig { - minSdkVersion(Config.minSdk) - targetSdkVersion(Config.targetSdk) - consumerProguardFiles("proguard-rules.pro") - multiDexEnabled = true - } - - buildTypes { - getByName("debug") { - isDebuggable = true - isTestCoverageEnabled = true + compileSdkVersion(Config.compileSdk) + // The version of Jacoco used by the android gradle plugin + jacoco { version = "0.8.7" } + + defaultConfig { + minSdkVersion(Config.minSdk) + targetSdkVersion(Config.targetSdk) + consumerProguardFiles("proguard-rules.pro") + multiDexEnabled = true } - } - - lintOptions { isAbortOnError = false } - - compileOptions { - sourceCompatibility(JavaVersion.VERSION_1_8) - targetCompatibility(JavaVersion.VERSION_1_8) - } - - kotlinOptions { jvmTarget = "1.8" } - - testOptions { - unitTests.all { - it.jvmArgs("-XX:MaxPermSize=1024m") - it.maxHeapSize = "4096m" - // CrashShieldHandlerDebugTest is only available on Sandcastle and Github Actions - // Because local compiling environment may recompile CrashShieldHandler multiple times - // and generate false signals - if (System.getenv("SANDCASTLE") != "1" && System.getenv("GITHUB_ACTIONS") != "1") { - it.exclude("com/facebook/internal/instrument/crashshield/CrashShieldHandlerDebugTest.class") - } - if (System.getenv("GITHUB_ACTIONS") == "1") { - it.exclude("com/facebook/appevents/ondeviceprocessing/OnDeviceProcessingManagerTest.class") - it.exclude("com/facebook/appevents/AutomaticAnalyticsTest.class") - it.exclude("com/facebook/appevents/iap/InAppPurchaseAutoLoggerTest.class") - it.exclude("com/facebook/appevents/iap/InAppPurchaseBillingClientWrapperV2V4Test.class") - } + + buildTypes { + getByName("debug") { + isDebuggable = true + isTestCoverageEnabled = true + } + } + + lintOptions { isAbortOnError = false } + + compileOptions { + sourceCompatibility(JavaVersion.VERSION_1_8) + targetCompatibility(JavaVersion.VERSION_1_8) } - } - sourceSets { named("test") { java.srcDir("src/test/kotlin") } } + kotlinOptions { jvmTarget = "1.8" } - if (System.getenv("SANDCASTLE") == "1") { testOptions { - unitTests.all { - it.systemProperty( - "robolectric.dependency.repo.url", - "https://maven.thefacebook.com/nexus/content/repositories/central/") - it.systemProperty("robolectric.dependency.repo.id", "central") - it.systemProperty("java.net.preferIPv6Addresses", "true") - it.systemProperty("java.net.preferIPv4Stack", "false") - } + unitTests.all { + it.jvmArgs("-XX:MaxPermSize=1024m") + it.maxHeapSize = "4096m" + // CrashShieldHandlerDebugTest is only available on Sandcastle and Github Actions + // Because local compiling environment may recompile CrashShieldHandler multiple times + // and generate false signals + if (System.getenv("SANDCASTLE") != "1" && System.getenv("GITHUB_ACTIONS") != "1") { + it.exclude("com/facebook/internal/instrument/crashshield/CrashShieldHandlerDebugTest.class") + } + if (System.getenv("GITHUB_ACTIONS") == "1") { + it.exclude("com/facebook/appevents/ondeviceprocessing/OnDeviceProcessingManagerTest.class") + it.exclude("com/facebook/appevents/AutomaticAnalyticsTest.class") + it.exclude("com/facebook/appevents/InternalAppEventsLoggerTest.class") + it.exclude("com/facebook/appevents/iap/InAppPurchaseAutoLoggerTest.class") + it.exclude("com/facebook/appevents/iap/InAppPurchaseBillingClientWrapperV2V4Test.class") + it.exclude("com/facebook/appevents/iap/InAppPurchaseLoggerManagerTest.class") + } + } + } + + sourceSets { named("test") { java.srcDir("src/test/kotlin") } } + + if (System.getenv("SANDCASTLE") == "1") { + testOptions { + unitTests.all { + it.systemProperty( + "robolectric.dependency.repo.url", + "https://maven.thefacebook.com/nexus/content/repositories/central/" + ) + it.systemProperty("robolectric.dependency.repo.id", "central") + it.systemProperty("java.net.preferIPv6Addresses", "true") + it.systemProperty("java.net.preferIPv4Stack", "false") + } + } } - } } if (file("${rootDir}/internal/safekit-build.gradle").exists()) { - project.apply(from = "${rootDir}/internal/safekit-build.gradle") + project.apply(from = "${rootDir}/internal/safekit-build.gradle") } apply(from = "${rootDir}/jacoco.gradle.kts")