Skip to content

Commit ff86c9e

Browse files
authored
Merge branch 'main' into mrober/crashlyticsGradleFunctionalTests
2 parents ff994f0 + b2a2bd2 commit ff86c9e

File tree

14 files changed

+57
-12
lines changed

14 files changed

+57
-12
lines changed

.github/workflows/perf-gradle-compatibility-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ jobs:
2424
id: tests
2525
run: |
2626
./gradlew \
27-
:firebase-perf-gradle:test --tests \
27+
:firebase-perf-gradle:functionalTest --tests \
2828
"com.google.firebase.perf.plugin.transform.InstrumentationApiCompatTest.gradleBuildRunsInstrumentationForAllVariants_latestGradleAndAgp"

firebase-appdistribution-gradle/src/integrationTest/java/com/google/firebase/appdistribution/gradle/UploadDistributionTaskTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ class UploadDistributionTaskTest {
724724
// Also remember to update the latest AGP/gradle versions in BeePlusGradleProject.java.
725725
// firebase-appdistribution-gradle/src/prodTest/java/com/google/firebase/appdistribution/gradle/BeePlusGradleProject.java#L59-L60
726726
private const val LATEST_GRADLE_VERSION = "9.3.1"
727-
private const val LATEST_AGP_VERSION = "9.1.0-alpha06"
727+
private const val LATEST_AGP_VERSION = "9.1.0-alpha07"
728728
private const val LATEST_GOOGLE_SERVICES_VERSION = "4.4.4"
729729
// For tests against Gradle 9, we get the error:
730730
// "In order to compile Java 9+ source, please set compileSdkVersion to 30 or above"

firebase-appdistribution-gradle/src/prodTest/java/com/google/firebase/appdistribution/gradle/BeePlusGradleProject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static String getRequiredSystemProperty(String propertyName) {
5858
static final String PACKAGE_NAME = "com.firebase.appdistribution.prober";
5959
// Also remember to update the latest AGP/gradle versions in UploadDistributionTaskTest.kt
6060
// firebase-appdistribution-gradle/src/integrationTest/java/com/google/firebase/appdistribution/gradle/UploadDistributionTaskTest.kt#L724-L726
61-
static final String LATEST_AGP_VERSION = "9.1.0-alpha06";
61+
static final String LATEST_AGP_VERSION = "9.1.0-alpha07";
6262
static final String LATEST_GRADLE_VERSION = "9.3.1";
6363
// The project number for App Distro Probes. We need to use this project
6464
// because this is the one that's actually linked to play for BeePlus,

firebase-appdistribution-gradle/src/prodTest/java/com/google/firebase/appdistribution/gradle/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ big changes, similar to how one would do manual testing via a test matrix.
1010

1111
### How to run
1212

13-
Before running the tests, you need to create a `local.properties` file in the root directory of the `firebase-android-buildtools` project with the following properties:
13+
Before running the tests, you need to create a `local.properties` file in the root directory of the `firebase-android-sdk` project with the following properties:
1414

1515
```properties
1616
sdk.dir=<path_to_android_sdk>

firebase-perf-gradle/firebase-perf-gradle.gradle

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@ gradlePlugin {
3636
}
3737
}
3838

39+
sourceSets {
40+
main {
41+
java {
42+
srcDirs = ['src/main/java']
43+
}
44+
}
45+
46+
test {
47+
java {
48+
srcDirs = ['src/test/java']
49+
}
50+
}
51+
52+
functionalTest {
53+
java {
54+
srcDirs = ['src/functionalTest/java']
55+
}
56+
}
57+
}
58+
3959
// Write the plugin's classpath to a file to share with the tests.
4060
// Refer: https://docs.gradle.org/current/userguide/test_kit.html#sub:test-kit-classpath-injection
4161
task createClasspathManifest {
@@ -62,11 +82,8 @@ dependencies {
6282
compileOnly("com.google.guava:guava:30.1-jre")
6383
compileOnly("commons-io:commons-io:2.6")
6484

65-
// Deps required to run the tests
66-
testRuntimeOnly(files(createClasspathManifest))
67-
testImplementation(gradleTestKit())
85+
// Deps for unit tests
6886
testImplementation("org.ow2.asm:asm:$project.asmApiVersion")
69-
testImplementation("com.android.tools.build:gradle:3.4.1")
7087
testImplementation("commons-io:commons-io:2.6")
7188
testImplementation(platform("org.junit:junit-bom:5.10.0"))
7289
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
@@ -76,10 +93,26 @@ dependencies {
7693
testImplementation("org.mockito:mockito-core:3.12.4")
7794
testImplementation("org.mockito:mockito-junit-jupiter:3.12.4")
7895

79-
testImplementation("com.google.android:android:4.1.1.4")
80-
testImplementation("com.squareup.okhttp3:okhttp:4.8.1")
81-
testImplementation("com.google.code.gson:gson:2.10.1")
82-
testImplementation("io.ktor:ktor-client-apache:1.4.0")
96+
// Deps for functional tests
97+
functionalTestRuntimeOnly(files(createClasspathManifest))
98+
functionalTestImplementation(gradleTestKit())
99+
functionalTestImplementation("org.ow2.asm:asm:$project.asmApiVersion")
100+
functionalTestImplementation("com.android.tools.build:gradle:7.2.0")
101+
functionalTestImplementation("com.android.tools:common:30.0.0")
102+
functionalTestImplementation("com.android.tools:sdk-common:30.0.0")
103+
functionalTestImplementation("commons-io:commons-io:2.6")
104+
functionalTestImplementation(platform("org.junit:junit-bom:5.10.0"))
105+
functionalTestImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
106+
functionalTestImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")
107+
functionalTestImplementation("org.junit.jupiter:junit-jupiter-params:5.10.0")
108+
functionalTestImplementation("com.google.truth:truth:0.42")
109+
functionalTestImplementation("org.mockito:mockito-core:3.12.4")
110+
functionalTestImplementation("org.mockito:mockito-junit-jupiter:3.12.4")
111+
functionalTestImplementation("com.google.android:android:4.1.1.4")
112+
functionalTestImplementation("com.squareup.okhttp3:okhttp:4.8.1")
113+
functionalTestImplementation("com.google.code.gson:gson:2.10.1")
114+
functionalTestImplementation("com.google.guava:guava:30.1-jre")
115+
functionalTestImplementation("io.ktor:ktor-client-apache:1.4.0")
83116
}
84117

85118
def props = new Properties()
@@ -136,7 +169,13 @@ publishing {
136169
}
137170

138171
test {
172+
useJUnitPlatform()
173+
}
174+
175+
task functionalTest(type: Test) {
139176
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
177+
testClassesDirs = sourceSets.functionalTest.output.classesDirs
178+
classpath = sourceSets.functionalTest.runtimeClasspath
140179
testLogging.showExceptions = true
141180
useJUnitPlatform()
142181
filter {
@@ -152,3 +191,9 @@ test {
152191
tasks.withType(ValidatePlugins).configureEach {
153192
enableStricterValidation = true
154193
}
194+
195+
afterEvaluate {
196+
tasks.named("deviceCheck") {
197+
dependsOn(functionalTest)
198+
}
199+
}

firebase-perf-gradle/src/test/java/com/google/firebase/perf/plugin/GradleBuildProject.java renamed to firebase-perf-gradle/src/functionalTest/java/com/google/firebase/perf/plugin/GradleBuildProject.java

File renamed without changes.

firebase-perf-gradle/src/test/java/com/google/firebase/perf/plugin/GradleBuildResult.java renamed to firebase-perf-gradle/src/functionalTest/java/com/google/firebase/perf/plugin/GradleBuildResult.java

File renamed without changes.

firebase-perf-gradle/src/test/java/com/google/firebase/perf/plugin/GradleBuildRunner.java renamed to firebase-perf-gradle/src/functionalTest/java/com/google/firebase/perf/plugin/GradleBuildRunner.java

File renamed without changes.

firebase-perf-gradle/src/test/java/com/google/firebase/perf/plugin/GradleBuildVariant.java renamed to firebase-perf-gradle/src/functionalTest/java/com/google/firebase/perf/plugin/GradleBuildVariant.java

File renamed without changes.

firebase-perf-gradle/src/test/java/com/google/firebase/perf/plugin/transform/InstrumentationApiCompatTest.java renamed to firebase-perf-gradle/src/functionalTest/java/com/google/firebase/perf/plugin/transform/InstrumentationApiCompatTest.java

File renamed without changes.

0 commit comments

Comments
 (0)