-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4957634
commit f8f75de
Showing
19 changed files
with
377 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
name: e2e-android | ||
|
||
on: pull_request | ||
|
||
env: | ||
E2E_TESTS: 1 # build without transform-remove-console babel plugin | ||
DEBUG: 'lnurl* lnurl server' | ||
|
||
jobs: | ||
e2e: | ||
runs-on: macos-12 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup Docker Colima 1 | ||
uses: douglascamata/setup-docker-macos-action@v1-alpha | ||
id: docker1 | ||
continue-on-error: true | ||
|
||
- name: Setup Docker Colima 2 | ||
if: steps.docker1.outcome != 'success' | ||
uses: douglascamata/setup-docker-macos-action@v1-alpha | ||
id: docker2 | ||
continue-on-error: true | ||
|
||
- name: Setup Docker Default | ||
if: steps.docker1.outcome != 'success' && steps.docker2.outcome != 'success' | ||
uses: docker-practice/actions-setup-docker@1.0.12 | ||
timeout-minutes: 30 | ||
|
||
# - name: Install AppleSimulatorUtils | ||
# run: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew && brew install applesimutils | ||
|
||
- name: Run regtest setup | ||
run: cd docker && mkdir lnd && chmod 777 lnd && docker-compose up -d | ||
|
||
- name: Wait for bitcoind | ||
timeout-minutes: 2 | ||
run: while ! nc -z '127.0.0.1' 43782; do sleep 1; done | ||
|
||
- name: Wait for electrum server | ||
timeout-minutes: 2 | ||
run: while ! nc -z '127.0.0.1' 60001; do sleep 1; done | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.17 | ||
cache: 'yarn' # cache packages, but not node_modules | ||
|
||
- name: Activate enviroment variables | ||
run: cp .env.test.template .env | ||
|
||
- name: Activate react-native-skia-stub | ||
run: patch -p1 < .github/workflows/react-native-skia-stub.patch | ||
|
||
- name: Activate Gradle variables | ||
run: cp .github/workflows/gradle.properties ~/.gradle/gradle.properties | ||
|
||
- name: Use specific Java version for sdkmanager to work | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Yarn Install | ||
run: yarn --no-audit --prefer-offline || yarn --no-audit --prefer-offline | ||
env: | ||
HUSKY: 0 | ||
|
||
- name: Build | ||
run: yarn e2e:build:android-release || yarn e2e:build:android-release | ||
|
||
- name: Test attempt 1 | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
continue-on-error: true | ||
id: test1 | ||
with: | ||
api-level: 31 | ||
avd-name: Pixel_API_31_AOSP | ||
force-avd-creation: false | ||
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | ||
arch: x86_64 | ||
script: | | ||
adb root | ||
adb reverse tcp:80 tcp:80 | ||
adb reverse tcp:8080 tcp:8080 | ||
adb reverse tcp:9735 tcp:9735 | ||
adb reverse tcp:10009 tcp:10009 | ||
adb reverse tcp:28334 tcp:28334 | ||
adb reverse tcp:28335 tcp:28335 | ||
adb reverse tcp:28336 tcp:28336 | ||
adb reverse tcp:39388 tcp:39388 | ||
adb reverse tcp:43782 tcp:43782 | ||
adb reverse tcp:60001 tcp:60001 | ||
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | ||
- name: Test attempt 2 | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
continue-on-error: true | ||
id: test2 | ||
if: steps.test1.outcome != 'success' | ||
with: | ||
api-level: 31 | ||
avd-name: Pixel_API_31_AOSP | ||
force-avd-creation: false | ||
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | ||
arch: x86_64 | ||
script: | | ||
adb root | ||
adb reverse tcp:80 tcp:80 | ||
adb reverse tcp:8080 tcp:8080 | ||
adb reverse tcp:9735 tcp:9735 | ||
adb reverse tcp:10009 tcp:10009 | ||
adb reverse tcp:28334 tcp:28334 | ||
adb reverse tcp:28335 tcp:28335 | ||
adb reverse tcp:28336 tcp:28336 | ||
adb reverse tcp:39388 tcp:39388 | ||
adb reverse tcp:43782 tcp:43782 | ||
adb reverse tcp:60001 tcp:60001 | ||
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | ||
- name: Test attempt 3 | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
continue-on-error: true | ||
id: test3 | ||
if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' | ||
with: | ||
api-level: 31 | ||
avd-name: Pixel_API_31_AOSP | ||
force-avd-creation: false | ||
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | ||
arch: x86_64 | ||
script: | | ||
adb root | ||
adb reverse tcp:80 tcp:80 | ||
adb reverse tcp:8080 tcp:8080 | ||
adb reverse tcp:9735 tcp:9735 | ||
adb reverse tcp:10009 tcp:10009 | ||
adb reverse tcp:28334 tcp:28334 | ||
adb reverse tcp:28335 tcp:28335 | ||
adb reverse tcp:28336 tcp:28336 | ||
adb reverse tcp:39388 tcp:39388 | ||
adb reverse tcp:43782 tcp:43782 | ||
adb reverse tcp:60001 tcp:60001 | ||
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | ||
- name: Test attempt 4 | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' && steps.test3.outcome != 'success' | ||
with: | ||
api-level: 31 | ||
avd-name: Pixel_API_31_AOSP | ||
force-avd-creation: false | ||
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 2047 | ||
arch: x86_64 | ||
script: | | ||
adb root | ||
adb reverse tcp:80 tcp:80 | ||
adb reverse tcp:8080 tcp:8080 | ||
adb reverse tcp:9735 tcp:9735 | ||
adb reverse tcp:10009 tcp:10009 | ||
adb reverse tcp:28334 tcp:28334 | ||
adb reverse tcp:28335 tcp:28335 | ||
adb reverse tcp:28336 tcp:28336 | ||
adb reverse tcp:39388 tcp:39388 | ||
adb reverse tcp:43782 tcp:43782 | ||
adb reverse tcp:60001 tcp:60001 | ||
yarn e2e:test:android-release --record-videos all --take-screenshots all --record-logs all | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: e2e-test-videos | ||
path: ./artifacts/ | ||
|
||
- name: Dump docker logs on failure | ||
if: failure() | ||
uses: jwalton/gh-docker-logs@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
BITKIT_UPLOAD_STORE_FILE=debug.keystore | ||
BITKIT_UPLOAD_STORE_PASSWORD=android | ||
BITKIT_UPLOAD_KEY_ALIAS=androiddebugkey | ||
BITKIT_UPLOAD_KEY_PASSWORD=android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
android/app/src/androidTest/java/com/bitkit/DetoxTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.bitkit; | ||
|
||
import com.wix.detox.Detox; | ||
import com.wix.detox.config.DetoxConfig; | ||
|
||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import androidx.test.filters.LargeTest; | ||
import androidx.test.rule.ActivityTestRule; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@LargeTest | ||
public class DetoxTest { | ||
@Rule | ||
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false); | ||
|
||
@Test | ||
public void runDetoxTests() { | ||
DetoxConfig detoxConfig = new DetoxConfig(); | ||
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90; | ||
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60; | ||
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60); | ||
|
||
Detox.runTests(mActivityRule, detoxConfig); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<network-security-config> | ||
<domain-config cleartextTrafficPermitted="true"> | ||
<domain includeSubdomains="true">10.0.2.2</domain> | ||
<domain includeSubdomains="true">localhost</domain> | ||
</domain-config> | ||
</network-security-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.