Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new tezos app swap tests #1

Merged
merged 16 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
135 changes: 18 additions & 117 deletions .github/workflows/reusable_swap_functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,26 @@ name: Reusable swap functional tests
on:
workflow_call:
inputs:
branch_for_exchange:
repo_for_exchange:
required: false
default: 'develop'
default: 'LedgerHQ/app-exchange'
type: string
branch_for_stellar:
branch_for_exchange:
required: false
default: 'develop'
type: string
branch_for_tezos:
required: false
default: 'develop'
type: string
branch_for_xrp:
required: false
default: 'develop'
default: 'main'
type: string
branch_for_ethereum:
required: false
default: 'develop'
type: string
branch_for_ethereum_classic:
required: false
default: 'develop'
type: string
branch_for_litecoin:
run_for_devices:
description: 'The list of device(s) on which the test will run (defaults to ["nanos", "nanox", "nanosp", "stax"])'
required: false
default: 'master'
type: string
branch_for_bitcoin_legacy:
required: false
default: 'master'
type: string
branch_for_bitcoin:
required: false
default: 'develop'
type: string
branch_for_solana:
required: false
default: 'develop'
type: string
branch_for_bsc:
required: false
default: 'develop'
default: '["nanos", "nanox", "nanosp", "stax"]'
type: string
test_filter:
required: false
Expand All @@ -59,41 +36,20 @@ jobs:
fail-fast: false
matrix:
coin:
- name: stellar
repo: app-stellar
branch: ${{ inputs.branch_for_stellar }}
- name: tezos
repo: app-tezos
- name: tezos_new
repo: trilitech/ledger-app-tezos-wallet
branch: ${{ inputs.branch_for_tezos }}
- name: xrp
repo: app-xrp
branch: ${{ inputs.branch_for_xrp }}
relative_app_directory: 'app'
- name: ethereum
repo: app-ethereum
repo: LedgerHQ/app-ethereum
branch: ${{ inputs.branch_for_ethereum }}
- name: ethereum_classic
repo: app-ethereum
branch: ${{ inputs.branch_for_ethereum_classic }}
- name: litecoin
repo: app-bitcoin
branch: ${{ inputs.branch_for_litecoin }}
- name: bitcoin_legacy
repo: app-bitcoin
branch: ${{ inputs.branch_for_bitcoin_legacy }}
- name: bitcoin
repo: app-bitcoin-new
branch: ${{ inputs.branch_for_bitcoin }}
- name: solana
repo: app-solana
branch: ${{ inputs.branch_for_solana }}
- name: bsc
repo: app-ethereum
branch: ${{ inputs.branch_for_bsc }}
relative_app_directory: '.'

uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
app_repository: LedgerHQ/${{ matrix.coin.repo }}
app_branch_name: ${{ matrix.coin.branch }}
app_repository: ${{ matrix.coin.repo }}
app_branch_name: ${{ matrix.coin.branch }}
relative_app_directory: ${{ matrix.coin.relative_app_directory }}
flags: "COIN=${{ matrix.coin.name }} CHAIN=${{ matrix.coin.name }} DEBUG=1"
upload_app_binaries_artifact: libraries_binaries
upload_as_lib_artifact: ${{ matrix.coin.name }}
Expand All @@ -102,7 +58,7 @@ jobs:
name: Build application using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
app_repository: LedgerHQ/app-exchange
app_repository: ${{ inputs.repo_for_exchange }}
app_branch_name: ${{ inputs.branch_for_exchange }}
flags: "TESTING=1 TEST_PUBLIC_KEY=1 DEBUG=1"
upload_app_binaries_artifact: exchange_binaries
Expand All @@ -114,65 +70,10 @@ jobs:
- build_sideloaded_applications
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
with:
app_repository: LedgerHQ/app-exchange
app_repository: ${{ inputs.repo_for_exchange }}
app_branch_name: ${{ inputs.branch_for_exchange }}
download_app_binaries_artifact: exchange_binaries
lib_binaries_artifact: libraries_binaries
test_dir: test/python
run_for_devices: ${{ inputs.run_for_devices }}
test_filter: ${{ inputs.test_filter }}

# Legacy
zemu_tests:
name: Zemu tests
strategy:
matrix:
# device: ["Nano S", "Nano X", "Nano SP"]
device: ["Nano S"]
needs:
- build_exchange_application
- build_sideloaded_applications
runs-on: ubuntu-latest

steps:
- name: Clone
uses: actions/checkout@v3
with:
repository: LedgerHQ/app-exchange
ref: ${{ inputs.branch_for_exchange }}

- name: Install APT dependencies
run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Yarn
run: npm install -g yarn

- name: Install JS dependencies
run: cd test && yarn install

- name: Download all binaries
uses: actions/download-artifact@v3

- name: Download exchange binaries
uses: actions/download-artifact@v3
with:
name: exchange_binaries
path: ./build/

- name: Download lib binaries
uses: actions/download-artifact@v3
with:
name: libraries_binaries
path: ./test/python/lib_binaries/

- name: Dispatch to the tests/elfs
run: |
./copy_elfs_for_zemu.sh
tree test/elfs

- name: Run zemu tests for device ${{ matrix.device }}
run: cd test && yarn test -t "\[${{ matrix.device }}\]"
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ litecoin_nanox.elf
stellar_nanos.elf
stellar_nanosp.elf
stellar_nanox.elf
tezos_nanos.elf
tezos_nanosp.elf
tezos_nanox.elf
tezos_legacy_nanos.elf
tezos_legacy_nanosp.elf
tezos_legacy_nanox.elf
tezos_new_nanos.elf
tezos_new_nanosp.elf
tezos_new_nanox.elf
xrp_nanos.elf
xrp_nanosp.elf
xrp_nanox.elf
Expand Down
9 changes: 6 additions & 3 deletions copy_elfs_for_zemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ cp test/python/lib_binaries/litecoin_nanox.elf test/elfs/litecoin_nanox.elf
cp test/python/lib_binaries/stellar_nanos.elf test/elfs/stellar_nanos.elf
cp test/python/lib_binaries/stellar_nanos2.elf test/elfs/stellar_nanosp.elf
cp test/python/lib_binaries/stellar_nanox.elf test/elfs/stellar_nanox.elf
cp test/python/lib_binaries/tezos_nanos.elf test/elfs/tezos_nanos.elf
cp test/python/lib_binaries/tezos_nanos2.elf test/elfs/tezos_nanosp.elf
cp test/python/lib_binaries/tezos_nanox.elf test/elfs/tezos_nanox.elf
cp test/python/lib_binaries/tezos_legacy_nanos.elf test/elfs/tezos_legacy_nanos.elf
cp test/python/lib_binaries/tezos_legacy_nanos2.elf test/elfs/tezos_legacy_nanosp.elf
cp test/python/lib_binaries/tezos_legacy_nanox.elf test/elfs/tezos_legacy_nanox.elf
cp test/python/lib_binaries/tezos_new_nanos.elf test/elfs/tezos_new_nanos.elf
cp test/python/lib_binaries/tezos_new_nanos2.elf test/elfs/tezos_new_nanosp.elf
cp test/python/lib_binaries/tezos_new_nanox.elf test/elfs/tezos_new_nanox.elf
cp test/python/lib_binaries/xrp_nanos.elf test/elfs/xrp_nanos.elf
cp test/python/lib_binaries/xrp_nanos2.elf test/elfs/xrp_nanosp.elf
cp test/python/lib_binaries/xrp_nanox.elf test/elfs/xrp_nanox.elf
Expand Down
6 changes: 5 additions & 1 deletion test/python/apps/cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from .stellar import XLM_PACKED_DERIVATION_PATH, XLM_CONF
from .solana_utils import SOL_PACKED_DERIVATION_PATH, SOL_CONF
from .xrp import XRP_PACKED_DERIVATION_PATH, XRP_CONF
from .tezos import XTZ_PACKED_DERIVATION_PATH, XTZ_CONF
from .tezos_legacy import XTZ_PACKED_DERIVATION_PATH, XTZ_CONF
from .tezos_new import NTZ_PACKED_DERIVATION_PATH, NTZ_CONF
from .bsc import BSC_PACKED_DERIVATION_PATH, BSC_CONF

TICKER_ID_TO_CONF = {
Expand All @@ -23,6 +24,7 @@
"SOL": SOL_CONF,
"XRP": XRP_CONF,
"XTZ": XTZ_CONF,
"NTZ": NTZ_CONF,
"BSC": BSC_CONF,
}

Expand All @@ -35,6 +37,7 @@
"SOL": SOL_PACKED_DERIVATION_PATH,
"XRP": XRP_PACKED_DERIVATION_PATH,
"XTZ": XTZ_PACKED_DERIVATION_PATH,
"NTZ": NTZ_PACKED_DERIVATION_PATH,
"BSC": BSC_PACKED_DERIVATION_PATH,
}

Expand All @@ -47,6 +50,7 @@
"SOL": SOL_PACKED_DERIVATION_PATH,
"XRP": XRP_PACKED_DERIVATION_PATH,
"XTZ": XTZ_PACKED_DERIVATION_PATH,
"NTZ": NTZ_PACKED_DERIVATION_PATH,
"BSC": BSC_PACKED_DERIVATION_PATH,
}

Expand Down
File renamed without changes.
Loading
Loading