Skip to content

Commit e012d73

Browse files
authored
Merge pull request #1121 from wordpress-mobile/ainfra-3575-does-aztec-android-need-firebase-secrets-mac-metal
Run connected tests on a mac-metal emulator
2 parents a115935 + 230ace5 commit e012d73

7 files changed

Lines changed: 22 additions & 50 deletions

File tree

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -euo pipefail
44

5-
echo "--- :closed_lock_with_key: Installing Secrets"
6-
./gradlew applyConfiguration
5+
echo "--- :robot_face: Starting Android emulator"
6+
start-android-emulator \
7+
--system-image "system-images;android-34;google_apis;arm64-v8a" \
8+
--device "pixel_5" \
9+
--logs-dir "build/emulator-logs"
710

8-
echo -e "\n--- :gcloud: Logging into Google Cloud"
9-
gcloud auth activate-service-account --key-file .configure-files/firebase.secrets.json
10-
11-
echo -e "\n--- :hammer_and_wrench: Building Tests"
12-
./gradlew --stacktrace app:assembleDebug app:assembleDebugAndroidTest
13-
14-
echo -e "\n--- :firebase: Run Tests"
15-
gcloud firebase test android run \
16-
--project api-project-108380595987 \
17-
--type instrumentation \
18-
--app app/build/outputs/apk/debug/app-debug.apk \
19-
--test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
20-
--device model=Nexus5X,version=26,locale=en,orientation=portrait \
21-
--verbosity info
11+
echo "--- :android: Running connected tests"
12+
./gradlew --stacktrace :app:connectedDebugAndroidTest

‎.buildkite/pipeline.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ steps:
3131
- label: "Connected Tests"
3232
key: "connected-test"
3333
command: .buildkite/commands/connected-tests.sh
34+
agents:
35+
queue: mac-metal
36+
timeout_in_minutes: 30
3437
plugins: [$CI_TOOLKIT]
3538
artifact_paths:
36-
- "aztec/build/test-results/**/*.xml"
39+
- "app/build/reports/androidTests/connected/**/*"
40+
- "app/build/outputs/androidTest-results/connected/**/*"
41+
- "build/emulator-logs/**/*"
3742

3843
- label: "Publish :aztec"
3944
key: "publish-aztec"

‎.configure‎

Lines changed: 0 additions & 11 deletions
This file was deleted.
-2.36 KB
Binary file not shown.

‎.gitignore‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ ktlint
5454
# Dependencies
5555
vendor
5656

57-
# Currently, the configure tool stores the encrypted files under
58-
# .configure-files. Everything in that folder without a .enc extension should
59-
# be ignored.
60-
.configure-files/*
61-
!.configure-files/*.enc
62-
63-
# Secrets files that should never be committed, regardless of location
57+
# Legacy: nothing uses this secret anymore, but devs may still have a decrypted copy locally.
58+
# Remove once they've had time to clean up: https://linear.app/a8c/issue/AINFRA-3580
6459
firebase.secrets.json
65-

‎app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
package org.wordpress.aztec.demo
44

5+
import android.os.Build
56
import android.util.Log
67
import androidx.test.rule.GrantPermissionRule
78
import androidx.test.runner.AndroidJUnit4
@@ -12,8 +13,11 @@ import org.junit.runner.RunWith
1213
abstract class BaseTest {
1314
@Rule
1415
@JvmField
15-
val grantPermissionRule: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.CAMERA,
16-
android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
16+
val grantPermissionRule: GrantPermissionRule = if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
17+
GrantPermissionRule.grant(android.Manifest.permission.CAMERA)
18+
} else {
19+
GrantPermissionRule.grant(android.Manifest.permission.CAMERA, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
20+
}
1721

1822
companion object {
1923
fun label(label: String) {

‎build.gradle‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

3-
buildscript {
4-
repositories {
5-
maven { url "https://a8c-libs.s3.amazonaws.com/android" }
6-
}
7-
dependencies {
8-
classpath 'com.automattic.android:configure:0.6.5'
9-
}
10-
}
11-
123
plugins {
134
id "com.android.application" apply false
145
id "org.jetbrains.kotlin.android" apply false
@@ -35,8 +26,6 @@ allprojects {
3526
}
3627
}
3728

38-
apply plugin: 'com.automattic.android.configure'
39-
4029
task clean(type: Delete) {
4130
delete rootProject.buildDir
4231
}

0 commit comments

Comments
 (0)