From 77b403096e0812dababccc1d28d35f58b4c22f8a Mon Sep 17 00:00:00 2001 From: Benjamin Forehand Jr Date: Wed, 3 Jul 2024 13:26:43 -0500 Subject: [PATCH] chore(nimbus): Fix fenix integration tests to not use circleci cache. (#10934) Because - Using the circleci cache on forks in our fenix integration tests doesn't work due to our security policy This commit - Fixes that by storing the APKs in a small docker image. Fixes #10933 --- .circleci/config.yml | 20 ++++++++----------- .../nimbus/android/build_android.sh | 1 + .../nimbus/android/fenix-apk-store.Dockerfile | 8 ++++++++ 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 experimenter/tests/integration/nimbus/android/fenix-apk-store.Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 3523e72ce..d88339a44 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -403,9 +403,6 @@ jobs: environment: PYTEST_ARGS: --reruns 1 steps: - - restore_cache: - keys: - - experimenter-firefox-fenix-apks - checkout - android/accept-licenses - android/create-avd: @@ -418,8 +415,10 @@ jobs: - run: name: Install APKs command: | - adb install /home/circleci/experimenter/experimenter/tests/integration/nimbus/android/app-fenix-x86_64-debug.apk - adb install /home/circleci/experimenter/experimenter/tests/integration/nimbus/android/app-fenix-debug-androidTest.apk + docker run -d --name fenix-files ${DOCKERHUB_REPO}:fenix-apk-store + docker cp fenix-files:/usr/src/app/files /home/circleci/project + adb install /home/circleci/project/files/app-fenix-x86_64-debug.apk + adb install /home/circleci/project/files/app-fenix-debug-androidTest.apk - run: name: Download test files and run command: | @@ -675,17 +674,14 @@ jobs: command: | cd experimenter/tests/integration/nimbus/android docker run --name fenix-builder ${DOCKERHUB_REPO}:experimenter-moz-central bash build_android.sh - docker cp fenix-builder:mozilla-central/mobile/android/fenix/app-fenix-debug-androidTest.apk ./ - docker cp fenix-builder:mozilla-central/mobile/android/fenix/app-fenix-x86_64-debug.apk ./ docker commit fenix-builder moz-central-builder docker tag moz-central-builder ${DOCKERHUB_REPO}:experimenter-moz-central docker push ${DOCKERHUB_REPO}:experimenter-moz-central + docker cp fenix-builder:mozilla-central/mobile/android/fenix/app-fenix-debug-androidTest.apk ./ + docker cp fenix-builder:mozilla-central/mobile/android/fenix/app-fenix-x86_64-debug.apk ./ + docker build -f fenix-apk-store.Dockerfile -t ${DOCKERHUB_REPO}:fenix-apk-store . + docker push ${DOCKERHUB_REPO}:fenix-apk-store no_output_timeout: 1h - - save_cache: - key: experimenter-firefox-fenix-apks-{{ checksum "experimenter/tests/integration/nimbus/android/app-fenix-x86_64-debug.apk" }} - paths: - - experimenter/tests/integration/nimbus/android/app-fenix-debug-androidTest.apk - - experimenter/tests/integration/nimbus/android/app-fenix-x86_64-debug.apk workflows: build_firefox: diff --git a/experimenter/tests/integration/nimbus/android/build_android.sh b/experimenter/tests/integration/nimbus/android/build_android.sh index 5ac0a06db..3a01b610d 100644 --- a/experimenter/tests/integration/nimbus/android/build_android.sh +++ b/experimenter/tests/integration/nimbus/android/build_android.sh @@ -4,6 +4,7 @@ set -euo pipefail hg pull && hg update +./mach clobber ./mach build cd mobile/android/fenix ./gradlew clean app:assembleFenixDebug diff --git a/experimenter/tests/integration/nimbus/android/fenix-apk-store.Dockerfile b/experimenter/tests/integration/nimbus/android/fenix-apk-store.Dockerfile new file mode 100644 index 000000000..ba393e02f --- /dev/null +++ b/experimenter/tests/integration/nimbus/android/fenix-apk-store.Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:latest + +WORKDIR /usr/src/app + +RUN mkdir -p /usr/src/app/files + +COPY app-fenix-debug-androidTest.apk /usr/src/app/files/ +COPY app-fenix-x86_64-debug.apk /usr/src/app/files/