Skip to content

Commit

Permalink
Merge pull request LedgerHQ#146 from LedgerHQ/pytest-timeout
Browse files Browse the repository at this point in the history
Add a default 5-min test timeout in ci
  • Loading branch information
bigspider authored Apr 19, 2023
2 parents 979a5f4 + aca46bb commit 1271309
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
run: |
cd tests
pip install -r requirements.txt
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --model=${{ matrix.model }}
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --model=${{ matrix.model }} --timeout=300
job_test_mainnet:
name: Tests on mainnet
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
run: |
cd tests_mainnet
pip install -r requirements.txt
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --model=${{ matrix.model }}
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --model=${{ matrix.model }} --timeout=300
job_test_python_lib_legacyapp:
name: Tests with the Python library and legacy Bitcoin app
Expand All @@ -204,7 +204,7 @@ jobs:
run: |
cd bitcoin_client/tests
pip install -r requirements.txt
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --timeout=300
job_test_js_lib:
Expand Down
1 change: 1 addition & 0 deletions bitcoin_client/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest>=6.1.1,<7.0.0
pytest-timeout>=2.1.0,<3.0.0
ledgercomm>=1.1.0,<1.2.0
ecdsa>=0.16.1,<0.17.0
typing-extensions>=3.7,<4.0
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest>=6.1.1,<7.0.0
pytest-timeout>=2.1.0,<3.0.0
ledgercomm>=1.1.0,<1.2.0
ecdsa>=0.16.1,<0.17.0
typing-extensions>=3.7,<4.0
Expand Down
1 change: 1 addition & 0 deletions tests/test_e2e_multisig.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def test_e2e_multisig_multiple_internal_keys(rpc: AuthServiceProxy, rpc_test_wal
rpc, rpc_test_wallet, client, speculos_globals, comm)


@pytest.mark.timeout(0) # disable timeout
def test_e2e_multisig_16_of_16(rpc: AuthServiceProxy, rpc_test_wallet, client: Client, speculos_globals: SpeculosGlobals, comm: Union[TransportClient, SpeculosClient], enable_slow_tests: bool):
# Largest supported multisig with sortedmulti.
# The time for an end-to-end execution on a real Ledger Nano S (including user's input) is about 520 seconds.
Expand Down
1 change: 1 addition & 0 deletions tests/test_sign_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ def test_sign_psbt_singlesig_large_amount(client: Client, comm: SpeculosClient,
(parsed_events["amounts"][0] == format_amount(CURRENCY_TICKER_ALT, out_amt)))


@pytest.mark.timeout(0) # disable timeout
@has_automation("automations/sign_with_default_wallet_accept.json")
def test_sign_psbt_singlesig_wpkh_512to256(client: Client, enable_slow_tests: bool):
# PSBT for a transaction with 512 inputs and 256 outputs (maximum currently supported in the app)
Expand Down
1 change: 1 addition & 0 deletions tests/test_sign_psbt_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ def test_sign_psbt_singlesig_large_amount_v1(client: Client, comm: SpeculosClien
(parsed_events["amounts"][0] == format_amount(CURRENCY_TICKER_ALT, out_amt)))


@pytest.mark.timeout(0) # disable timeout
@has_automation("automations/sign_with_default_wallet_accept.json")
def test_sign_psbt_singlesig_wpkh_512to256_v1(client: Client, enable_slow_tests: bool):
# PSBT for a transaction with 512 inputs and 256 outputs (maximum currently supported in the app)
Expand Down
1 change: 1 addition & 0 deletions tests_mainnet/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest>=6.1.1,<7.0.0
pytest-timeout>=2.1.0,<3.0.0
ledgercomm>=1.1.0,<1.2.0
ecdsa>=0.16.1,<0.17.0
typing-extensions>=3.7,<4.0
Expand Down

0 comments on commit 1271309

Please sign in to comment.