Skip to content

Commit

Permalink
Revert test workaround for Android SDK.
Browse files Browse the repository at this point in the history
  • Loading branch information
ting-yuan committed Nov 11, 2024
1 parent 862c89b commit fb04324
Showing 1 changed file with 2 additions and 31 deletions.
33 changes: 2 additions & 31 deletions integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ dependencies {
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:$aaCoroutinesVersion")
}

fun Test.configureCommonSettings() {
tasks.withType<Test> {
maxParallelForks = max(1, Runtime.getRuntime().availableProcessors() / 2)
systemProperty("kotlinVersion", kotlinBaseVersion)
systemProperty("kspVersion", version)
systemProperty("agpVersion", agpTestVersion)
Expand All @@ -39,33 +40,3 @@ fun Test.configureCommonSettings() {
dependsOn(":symbol-processing-cmdline:publishAllPublicationsToTestRepository")
dependsOn(":symbol-processing-aa-embeddable:publishAllPublicationsToTestRepository")
}

val agpCompatibilityTestClasses = listOf("**/AGP731IT.class", "**/AGP741IT.class")

// Create a new test task for the AGP compatibility tests
val agpCompatibilityTest by tasks.registering(Test::class) {
description = "Runs AGP compatibility tests with maxParallelForks = 1"
group = "verification"

// Include only the AGP compatibility tests
include(agpCompatibilityTestClasses)

// Set maxParallelForks to 1 to avoid race conditions when downloading SDKs with old AGPs
maxParallelForks = 1

// Apply common settings
configureCommonSettings()
}

tasks.named<Test>("test") {
maxParallelForks = max(1, Runtime.getRuntime().availableProcessors() / 2)

// Exclude test classes from agpCompatibilityTest
exclude(agpCompatibilityTestClasses)

// Apply common settings
configureCommonSettings()

// Ensure that 'test' depends on 'compatibilityTest'
dependsOn(agpCompatibilityTest)
}

0 comments on commit fb04324

Please sign in to comment.