Skip to content

Commit

Permalink
Add CI config to detox emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
NSeydoux committed Aug 8, 2024
1 parent d7ac6f3 commit f43a8e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ module.exports = {
type: 'android.emulator',
device: {
avdName: process.env.TEST_ANDROID_EMU
}
},
// If running in CI, the emulator requires additional configuration options.
bootArgs: process.env.NODE_ENV === "development" ? "" : "-no-snapshot -accel off -noaudio -no-boot-anim -camera-back none",
headless: process.env.NODE_ENV !== "development"
}
},
configurations: {
Expand Down
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ RUN sdkmanager --verbose ${ANDROID_SDK_PACKAGES}
RUN avdmanager --verbose create avd --name "pixel_7" --device "pixel_7" --package "system-images;android-34;google_apis_playstore;x86_64"

WORKDIR /inrupt-wallet-frontend/
COPY package.json package-lock.json ./
RUN echo "Installing the dependencies"
RUN npm ci

COPY .detoxrc.js app.config.ts metro.config.js tsconfig.json ./
COPY android-config/ ./android-config/
COPY api/ ./api/
COPY app/ ./app/
Expand All @@ -26,20 +30,15 @@ COPY hooks/ ./hooks/
COPY plugins/ ./plugins/
COPY types/ ./types/
COPY utils/ ./utils/
COPY .detoxrc.js app.config.ts metro.config.js package.json package-lock.json run-ui-tests.sh tsconfig.json ./
# The APK must be compiled beforehand
# TODO: Add a test checking for its presence
COPY android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk .
COPY android/app/build/outputs/apk/release/app-release.apk ./android/app/build/outputs/apk/release/app-release.apk
COPY android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk ./android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk

RUN chown circleci .

ENV CI=true
ENV SIGNING_CONFIG_PATH=/inrupt-wallet-frontend/android-config/signing-config.gradle

RUN echo "Installing the dependencies"
RUN npm ci

# The following starts an emulator, it seems successfully
#emulator @pixel -no-snapshot -accel off -no-window -noaudio -no-boot-anim -camera-back none
ENV TEST_ANDROID_EMU="pixel_7"

CMD ["bash", "-c", "npx detox test --configuration android.emu.release"]

0 comments on commit f43a8e9

Please sign in to comment.