From 38bf88c920ea7eb85b85e7a12a5fdbeec37f8a76 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Fri, 17 Nov 2023 15:56:30 +0100 Subject: [PATCH] Test Exchange with P1 version of apps --- .github/workflows/ci-workflow.yml | 22 ++++++++++++- .../reusable_swap_functional_tests.yml | 32 +++++++++++++------ test/python/test_swap_ltc_to_eth.py | 1 - 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index a0d47326..9d3d3b01 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -1,3 +1,4 @@ +--- name: Compilation & tests on: @@ -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' diff --git a/.github/workflows/reusable_swap_functional_tests.yml b/.github/workflows/reusable_swap_functional_tests.yml index 639f7774..4a1001aa 100644 --- a/.github/workflows/reusable_swap_functional_tests.yml +++ b/.github/workflows/reusable_swap_functional_tests.yml @@ -1,4 +1,5 @@ -name: Reusable swap functional tests +--- +name: Exchange functional tests on: workflow_call: @@ -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: @@ -109,21 +118,23 @@ 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 @@ -131,9 +142,10 @@ jobs: 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: @@ -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 diff --git a/test/python/test_swap_ltc_to_eth.py b/test/python/test_swap_ltc_to_eth.py index f82bfad4..964db9af 100644 --- a/test/python/test_swap_ltc_to_eth.py +++ b/test/python/test_swap_ltc_to_eth.py @@ -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")