Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/app-distribution-gradle-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,30 @@ jobs:
java-version: 17
distribution: temurin
cache: gradle

- name: Setup local.properties for prodTest
run: |
echo "${{ secrets.INTEG_TESTS_FAD_GRADLE_PROD_TEST_PROPERTIES }}" > local.properties

- name: Add FAD service-credentials.json
env:
INTEG_TESTS_FAD_SERVICE_CREDENTIALS: ${{ secrets.INTEG_TESTS_FAD_SERVICE_CREDENTIALS }}
if: env.INTEG_TESTS_FAD_SERVICE_CREDENTIALS != '' && env.INTEG_TESTS_FAD_SERVICE_CREDENTIALS != 'null'
run: |
echo $INTEG_TESTS_FAD_SERVICE_CREDENTIALS | base64 -d > firebase-appdistribution-gradle/service-credentials.json

- name: Run tests
id: tests
env:
FIREBASE_TOKEN: ${{ secrets.INTEG_TESTS_FAD_FIREBASE_TOKEN }}
run: |
./gradlew \
:firebase-appdistribution-gradle:integrationTest
:firebase-appdistribution-gradle:integrationTest \
:firebase-appdistribution-gradle:prodTest

- name: Upload Test Report
if: failure()
uses: actions/upload-artifact@v4
with:
name: integration-test-report
path: firebase-appdistribution-gradle/build/reports/tests/integrationTest/
path: firebase-appdistribution-gradle/build/reports/tests/
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ dependencies {

integrationTestImplementation(gradleApi())
integrationTestImplementation(gradleTestKit())
integrationTestImplementation(sourceSets.main.output)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Curious: Why is this needed? Is this about VersionUtils?

integrationTestImplementation("com.android.tools.build:gradle:7.2.0")
integrationTestImplementation(libs.junit)
integrationTestImplementation("com.github.tomakehurst:wiremock:2.26.3")
Expand All @@ -234,6 +235,7 @@ dependencies {

prodTestImplementation(gradleApi())
prodTestImplementation(gradleTestKit())
prodTestImplementation(sourceSets.main.output)
prodTestImplementation("com.android.tools.build:gradle:7.2.0")
prodTestImplementation(libs.junit)
prodTestImplementation("com.github.tomakehurst:wiremock:2.26.3")
Expand Down
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm. Being in src/main/ means that this code ends up in the "production" jar, even though it is only used for tests. I wonder if there is a better location for test infrastructure code.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ private static String getRequiredSystemProperty(String propertyName) {
static final String PACKAGE_NAME = "com.firebase.appdistribution.prober";
// Also remember to update the latest AGP/gradle versions in UploadDistributionTaskTest.kt
// firebase-appdistribution-gradle/src/integrationTest/java/com/google/firebase/appdistribution/gradle/UploadDistributionTaskTest.kt#L724-L726
static final String LATEST_AGP_VERSION = "9.2.0-alpha02";
static final String LATEST_GRADLE_VERSION = "9.4.1";
static final String LATEST_AGP_VERSION = VersionUtils.INSTANCE.fetchLatestAgpVersion();
static final String LATEST_GRADLE_VERSION = VersionUtils.INSTANCE.fetchLatestGradleVersion();
// The project number for App Distro Probes. We need to use this project

// because this is the one that's actually linked to play for BeePlus,
// which is required for AAB uploads.
private static final String PROJECT_NUMBER_SYSTEM_PROPERTY = "firebase.projectNumber";
Expand Down Expand Up @@ -184,7 +185,7 @@ public BuildResult runUploadAab() {

private String getToken() {
String token = System.getenv("FIREBASE_TOKEN");
if (token == null || token.isEmpty()) {
if (isNullOrEmpty(token)) {
throw new IllegalStateException(
"FIREBASE_TOKEN environment variable not set. This is required for production tests.");
}
Expand Down
Loading