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

Test Exchange with P1 version of apps #158

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 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,25 @@ 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'
artefact_suffix: '_p1'
29 changes: 19 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 @@ -93,10 +94,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 @@ -143,29 +152,29 @@ jobs:
app_repository: ${{ matrix.coin.repo }}
app_branch_name: ${{ matrix.coin.branch }}
flags: "COIN=${{ matrix.coin.name }} CHAIN=${{ matrix.coin.name }}"
upload_app_binaries_artifact: libraries_binaries
upload_app_binaries_artifact: 'libraries_binaries${{ inputs.artefact_suffix }}'
upload_as_lib_artifact: ${{ matrix.coin.name }}

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"
upload_app_binaries_artifact: exchange_binaries
upload_app_binaries_artifact: 'exchange_binaries${{ inputs.artefact_suffix }}'

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 }}

# Legacy
Expand Down Expand Up @@ -207,13 +216,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
Loading