Skip to content

Commit

Permalink
Merge branch 'zingolabs:dev' into dev_RN_keychain_keystore_saving_wal…
Browse files Browse the repository at this point in the history
…let_keys
  • Loading branch information
juanky201271 authored Oct 3, 2024
2 parents 9dd204c + f07a315 commit 9bb5230
Show file tree
Hide file tree
Showing 20 changed files with 759 additions and 683 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
TIMESTAMP: ${{ inputs.timestamp }}

jobs:
android-ubuntu-e2e-test-actions-avd-cache:
android-ubuntu-e2e-test-ci-avd-cache:
name: Avd Cache e2e
runs-on: ubuntu-22.04
env:
Expand Down Expand Up @@ -64,6 +64,12 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: JVM Heap Size
run: export _JAVA_OPTIONS="-Xmx4g"

- name: Monitor memory usage
run: top -b -n1 | head -n 20

- name: Check AVD cache
uses: actions/cache/restore@v4
id: avd-cache
Expand All @@ -84,6 +90,10 @@ jobs:
emulator-options: -no-snapshot-load -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
ram-size: 4096M
heap-size: 512M
disk-size: 4096M
pre-emulator-launch-script: top -b -n1 | head -n 20

- name: Save AVD cache
if: steps.avd-cache.outputs.cache-hit != 'true'
Expand All @@ -95,9 +105,9 @@ jobs:
~/.android/adb*
key: avd-${{ env.ABI }}-api-${{ env.API-LEVEL }}-e2e

android-ubuntu-e2e-test-actions:
android-ubuntu-e2e-test-ci:
name: Android Ubuntu e2e test
needs: android-ubuntu-e2e-test-actions-avd-cache
needs: android-ubuntu-e2e-test-ci-avd-cache
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -168,7 +178,7 @@ jobs:
- name: Grant permissions
run: |
sudo chmod 777 /var/run/docker.sock
sudo chmod 777 ./scripts/e2e_tests_actions.sh
sudo chmod 777 ./scripts/ci/e2e_tests_ci.sh
- name: Enable KVM
run: |
Expand All @@ -179,7 +189,8 @@ jobs:
- name: Install protoc
run: sudo apt install protobuf-compiler

- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

Expand Down Expand Up @@ -253,6 +264,12 @@ jobs:
echo "Disk space after post-build cleanup:"
df -h
- name: JVM Heap Size
run: export _JAVA_OPTIONS="-Xmx4g"

- name: Monitor memory usage
run: top -b -n1 | head -n 20

- name: Run e2e Test
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -261,8 +278,12 @@ jobs:
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: cargo nextest run e2e::${{ matrix.test }} --features "ci regchest actions" --verbose --release
script: cargo nextest run e2e::${{ env.NEXTEST-ABI }}::${{ matrix.test }} --features "ci regchest" --verbose --release
working-directory: ./rust
ram-size: 4096M
heap-size: 512M
disk-size: 4096M
pre-emulator-launch-script: top -b -n1 | head -n 20

- name: Upload test reports
if: ${{ ! cancelled() }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
TIMESTAMP: ${{ inputs.timestamp }}

jobs:
android-ubuntu-integration-test-actions-avd-cache:
android-ubuntu-integration-test-ci-avd-cache:
name: Avd Cache Integration
runs-on: ubuntu-22.04
env:
Expand Down Expand Up @@ -95,9 +95,9 @@ jobs:
~/.android/adb*
key: avd-${{ env.ABI }}-api-${{ env.API-LEVEL }}-integ

android-ubuntu-integration-test-actions:
android-ubuntu-integration-test-ci:
name: Android Ubuntu Integration test
needs: android-ubuntu-integration-test-actions-avd-cache
needs: android-ubuntu-integration-test-ci-avd-cache
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
- name: Grant permissions
run: |
sudo chmod 777 /var/run/docker.sock
sudo chmod 777 ./scripts/integration_tests_actions.sh
sudo chmod 777 ./scripts/ci/integration_tests_ci.sh
- name: Enable KVM
run: |
Expand All @@ -173,7 +173,8 @@ jobs:
- name: Install protoc
run: sudo apt install protobuf-compiler

- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

Expand Down Expand Up @@ -255,7 +256,7 @@ jobs:
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: cargo nextest run ${{ env.NEXTEST-ABI }}::${{ matrix.test }} --features "ci regchest actions" --verbose --release
script: cargo nextest run integration::${{ env.NEXTEST-ABI }}::${{ matrix.test }} --features "ci regchest" --verbose --release
working-directory: ./rust

- name: Upload test reports
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
cache-key: ${{ needs.create-cache-key.outputs.cache-key }}
arch: ${{ matrix.arch }}

android-ubuntu-integration-test-actions:
android-ubuntu-integration-test-ci:
strategy:
matrix:
abi: [ x86_64, x86, arm64-v8a, armeabi-v7a ]
uses: ./.github/workflows/android-ubuntu-integration-test-actions.yaml
uses: ./.github/workflows/android-ubuntu-integration-test-ci.yaml
needs: [create-timestamp, android-build]
with:
timestamp: ${{ needs.create-timestamp.outputs.timestamp }}
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,33 @@ jobs:
cache-key: ${{ needs.create-cache-key.outputs.cache-key }}
arch: ${{ matrix.arch }}

android-ubuntu-integration-test-actions:
android-ubuntu-integration-test-ci:
strategy:
matrix:
abi: [ x86_64, x86 ]
uses: ./.github/workflows/android-ubuntu-integration-test-actions.yaml
config:
- { abi: x86_64, api-level: 34 }
- { abi: x86, api-level: 29 }
uses: ./.github/workflows/android-ubuntu-integration-test-ci.yaml
needs: [create-timestamp, android-build]
with:
timestamp: ${{ needs.create-timestamp.outputs.timestamp }}
cache-key: ${{ needs.create-cache-key.outputs.cache-key }}
abi: ${{ matrix.abi }}
api-level: 29
abi: ${{ matrix.config.abi }}
api-level: ${{ matrix.config['api-level'] }}

android-ubuntu-e2e-test-actions:
android-ubuntu-e2e-test-ci:
strategy:
matrix:
abi: [ x86_64 ]
uses: ./.github/workflows/android-ubuntu-e2e-test-actions.yaml
config:
- { abi: x86_64, api-level: 30 }
- { abi: x86, api-level: 28 }
uses: ./.github/workflows/android-ubuntu-e2e-test-ci.yaml
needs: [create-timestamp, android-build]
with:
timestamp: ${{ needs.create-timestamp.outputs.timestamp }}
cache-key: ${{ needs.create-cache-key.outputs.cache-key }}
abi: ${{ matrix.abi }}
api-level: 29
abi: ${{ matrix.config.abi }}
api-level: ${{ matrix.config['api-level'] }}

ios-build:
uses: ./.github/workflows/ios-build.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/old/android-e2e-test-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
REPO-OWNER: ${{ github.repository_owner }}

jobs:
android-e2e-test-actions:
android-e2e-test-ci:
name: End-to-end test
runs-on: ubuntu-22.04
strategy:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/old/android-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
- name: Install protoc
run: brew install protobuf

- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

Expand Down
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,23 @@ network in a docker container. Before running tests, pull the latest Regchest im
1. Create quick-boot snapshots to speed up AVD launch times. From the root directory, run: <br />
`./scripts/integration_tests.sh -a x86_64 -s` <br />
`./scripts/integration_tests.sh -a x86 -s` <br />
By default, this uses Google Playstore API 30 system images. Other images may be used for testing
By default, this uses default API 29 system images. Other images may be used for testing
by specifying the api level and target. However, using other images with the cargo test runner
is still under development.
2. To run the integration tests. From the `rust` directory, run: <br />
`cargo nextest run -E 'not test(e2e)'` <br />
`cargo nextest run integration` <br />
Specify to run specific ABI: <br />
`cargo nextest run x86_64` <br />
`cargo nextest run x86_32` <br />
`cargo nextest run arm64` <br />
`cargo nextest run arm32` <br />
`cargo nextest run integration::x86_64` <br />
`cargo nextest run integration::x86_32` <br />
`cargo nextest run integration::arm64` <br />
`cargo nextest run integration::arm32` <br />
Specify to run a specific test on all ABIs: <br />
`cargo nextest run test_name` <br />
Specify to run a specific ABI and test: <br />
`cargo nextest run x86_64::test_name`
`cargo nextest run integration::x86_64::test_name`

To run tests with Regchest, add the `--features regchest` flag, for example: <br />
`cargo nextest run --features regchest -E 'not test(e2e)'`
`cargo nextest run integration --features regchest`

For more information on running integration tests on non-default AVDs, run: <br />
`./scripts/integration_tests.sh -h` <br />
Expand All @@ -159,13 +159,24 @@ lightwalletd/zcashd regtest network. Therefore, only tests in the "Offline Tests
details.
2. In a terminal, run: <br />
`yarn start`
3. In a separate terminal, from the `rust` directory, run all tests: <br />
3. Create quick-boot snapshots to speed up AVD launch times. From the root directory, run: <br />
`./scripts/e2e_tests.sh -a x86_64 -s` <br />
`./scripts/e2e_tests.sh -a x86 -s` <br />
By default, this uses default API 29 system images. Other images may be used for testing
by specifying the api level and target. However, using other images with the cargo test runner
is still under development.
4. In a separate terminal, from the `rust` directory, run all tests: <br />
`cargo nextest run e2e`
or run a specific test: <br />
`cargo nextest run e2e::test_name`
Specify to run specific ABI: <br />
`cargo nextest run e2e::x86_64` <br />
`cargo nextest run e2e::x86_32` <br />
`cargo nextest run e2e::arm64` <br />
`cargo nextest run e2e::arm32` <br />
Specify to run a specific ABI and test: <br />
`cargo nextest run e2e::x86_64::test_name`

Regchest is still under development and currently not able to run darkside end-to-end tests: <br />
`cargo nextest run --features regchest -E 'test(e2e) and not test(darkside)'`
`cargo nextest run e2e --features regchest -E 'not test(darkside)'`

# Troubleshooting
For notes on known issues and problems, see the [trouble-shooting notes](./TROUBLESHOOTING.md).
2 changes: 1 addition & 1 deletion ios/.xcode.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NODE_BINARY=~/.nvm/versions/node/v20.9.0/bin/node
NODE_BINARY=$(which node)
Loading

0 comments on commit 9bb5230

Please sign in to comment.