diff --git a/.buildkite/commands/connected-tests.sh b/.buildkite/commands/connected-tests.sh index 2fc465dbf..e738ffa82 100644 --- a/.buildkite/commands/connected-tests.sh +++ b/.buildkite/commands/connected-tests.sh @@ -1,21 +1,12 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -echo "--- :closed_lock_with_key: Installing Secrets" -./gradlew applyConfiguration +echo "--- :robot_face: Starting Android emulator" +start-android-emulator \ + --system-image "system-images;android-34;google_apis;arm64-v8a" \ + --device "pixel_5" \ + --logs-dir "build/emulator-logs" -echo -e "\n--- :gcloud: Logging into Google Cloud" -gcloud auth activate-service-account --key-file .configure-files/firebase.secrets.json - -echo -e "\n--- :hammer_and_wrench: Building Tests" -./gradlew --stacktrace app:assembleDebug app:assembleDebugAndroidTest - -echo -e "\n--- :firebase: Run Tests" -gcloud firebase test android run \ - --project api-project-108380595987 \ - --type instrumentation \ - --app app/build/outputs/apk/debug/app-debug.apk \ - --test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \ - --device model=Nexus5X,version=26,locale=en,orientation=portrait \ - --verbosity info +echo "--- :android: Running connected tests" +./gradlew --stacktrace :app:connectedDebugAndroidTest diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index df142f5ba..d0fd162b0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -31,9 +31,14 @@ steps: - label: "Connected Tests" key: "connected-test" command: .buildkite/commands/connected-tests.sh + agents: + queue: mac-metal + timeout_in_minutes: 30 plugins: [$CI_TOOLKIT] artifact_paths: - - "aztec/build/test-results/**/*.xml" + - "app/build/reports/androidTests/connected/**/*" + - "app/build/outputs/androidTest-results/connected/**/*" + - "build/emulator-logs/**/*" - label: "Publish :aztec" key: "publish-aztec" diff --git a/.configure b/.configure deleted file mode 100644 index d0982ba4d..000000000 --- a/.configure +++ /dev/null @@ -1,11 +0,0 @@ -{ - "project_name": "aztec-android", - "branch": "trunk", - "pinned_hash": "f1a61c572902401898e7e1c060b86d9da7baf8fa", - "files_to_copy": [ - { - "file": "android/WPAndroid/firebase.secrets.json", - "destination": ".configure-files/firebase.secrets.json" - } - ] -} \ No newline at end of file diff --git a/.configure-files/firebase.secrets.json.enc b/.configure-files/firebase.secrets.json.enc deleted file mode 100644 index 77ba472e3..000000000 Binary files a/.configure-files/firebase.secrets.json.enc and /dev/null differ diff --git a/.gitignore b/.gitignore index 38e2f5750..b932bcbed 100644 --- a/.gitignore +++ b/.gitignore @@ -54,12 +54,6 @@ ktlint # Dependencies vendor -# Currently, the configure tool stores the encrypted files under -# .configure-files. Everything in that folder without a .enc extension should -# be ignored. -.configure-files/* -!.configure-files/*.enc - -# Secrets files that should never be committed, regardless of location +# Legacy: nothing uses this secret anymore, but devs may still have a decrypted copy locally. +# Remove once they've had time to clean up: https://linear.app/a8c/issue/AINFRA-3580 firebase.secrets.json - diff --git a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt index df840aac5..0ee9d62f3 100644 --- a/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt +++ b/app/src/androidTest/kotlin/org/wordpress/aztec/demo/BaseTest.kt @@ -2,6 +2,7 @@ package org.wordpress.aztec.demo +import android.os.Build import android.util.Log import androidx.test.rule.GrantPermissionRule import androidx.test.runner.AndroidJUnit4 @@ -12,8 +13,11 @@ import org.junit.runner.RunWith abstract class BaseTest { @Rule @JvmField - val grantPermissionRule: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.CAMERA, - android.Manifest.permission.WRITE_EXTERNAL_STORAGE) + val grantPermissionRule: GrantPermissionRule = if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) { + GrantPermissionRule.grant(android.Manifest.permission.CAMERA) + } else { + GrantPermissionRule.grant(android.Manifest.permission.CAMERA, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) + } companion object { fun label(label: String) { diff --git a/build.gradle b/build.gradle index 878b2e1c2..b697472d6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,5 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -buildscript { - repositories { - maven { url "https://a8c-libs.s3.amazonaws.com/android" } - } - dependencies { - classpath 'com.automattic.android:configure:0.6.5' - } -} - plugins { id "com.android.application" apply false id "org.jetbrains.kotlin.android" apply false @@ -35,8 +26,6 @@ allprojects { } } -apply plugin: 'com.automattic.android.configure' - task clean(type: Delete) { delete rootProject.buildDir }