Skip to content

Commit

Permalink
Test Exchange with P1 version of apps
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Nov 17, 2023
1 parent 8a837bb commit d8fac18
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Compilation & tests

on:
Expand All @@ -9,7 +10,26 @@ on:
pull_request:

jobs:
job_swap_functional_tests:
test_p4:
name: Against P4
uses: ./.github/workflows/reusable_swap_functional_tests.yml
with:
branch_for_exchange: ${{ github.ref }}
artefact_suffix: '_p4'

test_p1:
name: Against P1
uses: ./.github/workflows/reusable_swap_functional_tests.yml
with:
branch_for_exchange: ${{ github.ref }}
branch_for_stellar: 'master'
branch_for_tezos: 'master'
branch_for_xrp: 'master'
branch_for_ethereum: 'master'
branch_for_bitcoin_legacy: 'master'
branch_for_bitcoin: 'master'
branch_for_solana: 'master'
branch_for_polkadot: 'main'
branch_for_tron: 'master'
run_for_devices: '["nanos", "nanox", "nanosp"]'
artefact_suffix: '_p1'
32 changes: 22 additions & 10 deletions .github/workflows/reusable_swap_functional_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Reusable swap functional tests
---
name: Exchange functional tests

on:
workflow_call:
Expand Down Expand Up @@ -47,10 +48,18 @@ on:
required: false
default: '""'
type: string
run_for_devices:
required: false
default: '["nanos", "nanox", "nanosp", "stax"]'
type: string
artefact_suffix:
required: false
default: ''
type: string

jobs:
build_sideloaded_applications:
name: Build sideloaded applications using the reusable workflow
name: Build libraries
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -109,31 +118,34 @@ jobs:
app_repository: LedgerHQ/${{ matrix.coin.repo }}
app_branch_name: ${{ matrix.coin.branch }}
flags: "COIN=${{ matrix.coin.name }} CHAIN=${{ matrix.coin.name }} DEBUG=1"
upload_app_binaries_artifact: libraries_binaries
upload_app_binaries_artifact: 'libraries_binaries${{ inputs.artefact_suffix }}'
upload_as_lib_artifact: ${{ matrix.coin.name }}
relative_app_directory: ${{ matrix.coin.dir }}
run_for_devices: ${{ inputs.run_for_devices }}

build_exchange_application:
name: Build application using the reusable workflow
name: Build Exchange
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
app_repository: LedgerHQ/app-exchange
app_branch_name: ${{ inputs.branch_for_exchange }}
flags: "TESTING=1 TEST_PUBLIC_KEY=1 DEBUG=1"
upload_app_binaries_artifact: exchange_binaries
upload_app_binaries_artifact: 'exchange_binaries${{ inputs.artefact_suffix }}'
run_for_devices: ${{ inputs.run_for_devices }}

ragger_tests:
name: Run ragger tests using the reusable workflow
name: Run tests
needs:
- build_exchange_application
- build_sideloaded_applications
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
with:
app_repository: LedgerHQ/app-exchange
app_branch_name: ${{ inputs.branch_for_exchange }}
download_app_binaries_artifact: exchange_binaries
lib_binaries_artifact: libraries_binaries
download_app_binaries_artifact: exchange_binaries${{ inputs.artefact_suffix }}'
lib_binaries_artifact: libraries_binaries${{ inputs.artefact_suffix }}'
test_filter: ${{ inputs.test_filter }}
run_for_devices: ${{ inputs.run_for_devices }}

# Legacy
zemu_tests:
Expand Down Expand Up @@ -174,13 +186,13 @@ jobs:
- name: Download exchange binaries
uses: actions/download-artifact@v3
with:
name: exchange_binaries
name: exchange_binaries${{ inputs.artefact_suffix }}
path: ./build/

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

- name: Dispatch to the tests/elfs
Expand Down
1 change: 0 additions & 1 deletion test/python/test_swap_ltc_to_eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from .apps.exchange_transaction_builder import get_partner_curve, extract_payout_ticker, extract_refund_ticker, craft_and_sign_tx
from .apps import cal as cal


def test_swap_ltc_to_eth(backend, exchange_navigation_helper):
ex = ExchangeClient(backend, Rate.FIXED, SubCommand.SWAP)
partner = SigningAuthority(curve=get_partner_curve(SubCommand.SWAP), name="Default name")
Expand Down

0 comments on commit d8fac18

Please sign in to comment.