1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-15 06:45:59 +00:00

test(core): automatically skip altcoin tests

This commit is contained in:
Roman Zeyde 2025-04-07 21:26:31 +03:00 committed by Roman Zeyde
parent 8df465d7e8
commit 69ce947d71
6 changed files with 38 additions and 44 deletions

View File

@ -33,7 +33,6 @@ jobs:
env:
TREZOR_MODEL: ${{ matrix.model }}
BITCOIN_ONLY: ${{ matrix.coins == 'btconly' && '1' || '0' }}
TREZOR_PYTEST_SKIP_ALTCOINS: ${{ matrix.coins == 'btconly' && '1' || '0' }}
PYTEST_TIMEOUT: 600 # 10m single test timeout
PYOPT: 0
DISABLE_OPTIGA: 1
@ -118,7 +117,6 @@ jobs:
matrix:
coins: [universal, btconly]
env:
TREZOR_PYTEST_SKIP_ALTCOINS: ${{ matrix.coins == 'btconly' && '1' || '0' }}
PYTEST_TIMEOUT: 1200
T1_UHUB_LOCATION: 3-1
T1_UHUB_PORT: 2

View File

@ -273,7 +273,6 @@ jobs:
env:
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
TREZOR_MODEL: ${{ matrix.model }}
TREZOR_PYTEST_SKIP_ALTCOINS: ${{ matrix.coins == 'btconly' && '1' || '0' }}
TREZOR_PYTEST_LOGS_DIR: ${{ github.workspace }}/tests/
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
PYTEST_TIMEOUT: ${{ matrix.asan == 'asan' && 600 || 400 }}

View File

@ -120,7 +120,6 @@ jobs:
asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }}
env:
EMULATOR: 1
TREZOR_PYTEST_SKIP_ALTCOINS: ${{ matrix.coins == 'universal' && '0' || '1' }}
PYTEST_TIMEOUT: 120
steps:
- uses: actions/checkout@v4

View File

@ -149,7 +149,6 @@ core btconly device test:
- core unix frozen btconly debug build
variables:
MICROPYTHON: "build/unix/trezor-emu-core-bitcoinonly"
TREZOR_PYTEST_SKIP_ALTCOINS: 1
script:
- $NIX_SHELL --run "poetry run make -C core test_emu | ts -s"
artifacts:
@ -171,7 +170,6 @@ core btconly device asan test:
- schedules # nightly build
variables:
MICROPYTHON: "build/unix/trezor-emu-core-bitcoinonly"
TREZOR_PYTEST_SKIP_ALTCOINS: 1
PYTEST_TIMEOUT: "600"
script:
- $NIX_SHELL --run "poetry run make -C core test_emu | ts -s"
@ -576,7 +574,6 @@ legacy btconly test:
variables:
EMULATOR: "1"
EMULATOR_BINARY: "firmware/trezor-bitcoinonly.elf"
TREZOR_PYTEST_SKIP_ALTCOINS: 1
script:
- $NIX_SHELL --run "poetry run make -C legacy test_emu | ts -s"
artifacts:
@ -598,7 +595,6 @@ legacy btconly asan test:
variables:
EMULATOR: "1"
EMULATOR_BINARY: "firmware/trezor-bitcoinonly.elf"
TREZOR_PYTEST_SKIP_ALTCOINS: 1
script:
- $NIX_SHELL --run "poetry run make -C legacy test_emu | ts -s"

View File

@ -175,85 +175,85 @@ See [docs/tests/ui-tests](../tests/ui-tests.md) for more info.
### [core btconly device test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L145)
Device tests excluding altcoins, only for BTC.
### [core btconly device asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L165)
### [core btconly device asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L164)
### [core monero test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L186)
### [core monero test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L184)
Monero tests.
### [core monero asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L206)
### [core monero asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L204)
### [core u2f test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L229)
### [core u2f test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L227)
Tests for U2F and HID.
### [core u2f asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L248)
### [core u2f asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L246)
### [core fido2 test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L266)
### [core fido2 test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L264)
FIDO2 device tests.
### [core fido2 asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L289)
### [core fido2 asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L287)
### [core click test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L309)
### [core click test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L307)
Click tests - UI.
See [docs/tests/click-tests](../tests/click-tests.md) for more info.
### [core click R test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L341)
### [core click R test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L339)
Click tests.
See [docs/tests/click-tests](../tests/click-tests.md) for more info.
### [core click asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L370)
### [core click asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L368)
### [core upgrade test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L391)
### [core upgrade test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L389)
Upgrade tests.
See [docs/tests/upgrade-tests](../tests/upgrade-tests.md) for more info.
### [core upgrade asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L410)
### [core upgrade asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L408)
### [core persistence test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L432)
### [core persistence test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L430)
Persistence tests - UI.
### [core persistence asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L462)
### [core persistence asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L460)
### [core hwi test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L480)
### [core hwi test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L478)
### [crypto test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L499)
### [crypto test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L497)
### [legacy device test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L531)
### [legacy device test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L529)
Legacy device test - UI.
### [legacy asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L559)
### [legacy asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L557)
### [legacy btconly test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L571)
### [legacy btconly test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L569)
### [legacy btconly asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L591)
### [legacy btconly asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L588)
### [legacy upgrade test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L606)
### [legacy upgrade test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L602)
### [legacy upgrade asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L625)
### [legacy upgrade asan test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L621)
### [legacy hwi test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L646)
### [legacy hwi test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L642)
### [python test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L666)
### [python test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L662)
### [python support test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L685)
### [python support test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L681)
### [rust test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L694)
### [rust test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L690)
### [storage test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L704)
### [storage test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L700)
### [core unix memory profiler](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L728)
### [core unix memory profiler](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L724)
### [core firmware flash size checker](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L754)
### [core firmware flash size checker](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L750)
Finds out how much flash space we have left in the firmware build
Fails if the free space is less than certain threshold
### [core firmware flash size compare master](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L767)
### [core firmware flash size compare master](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L763)
Compares the current flash space with the situation in the current master
Fails if the new binary is significantly larger than the master one
(the threshold is defined in the script, currently 5kb).
Allowing fir failure, not to prevent the merge.
Also generates a report with the current situation
### [connect test core](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L782)
### [connect test core](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L778)
---
## TEST-NONENGLISH stage - [test-nonenglish.yml](https://github.com/trezor/trezor-firmware/blob/master/ci/test-nonenglish.yml)

View File

@ -27,7 +27,7 @@ import xdist
from _pytest.python import IdMaker
from _pytest.reports import TestReport
from trezorlib import debuglink, log, models
from trezorlib import debuglink, log, messages, models
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.device import apply_settings
from trezorlib.device import wipe as wipe_device
@ -270,6 +270,12 @@ def client(
if _raw_client.model not in models_filter:
pytest.skip(f"Skipping test for model {_raw_client.model.internal_name}")
is_btc_only = (
messages.Capability.Bitcoin_like not in _raw_client.features.capabilities
)
if request.node.get_closest_marker("altcoin") and is_btc_only:
pytest.skip("Skipping altcoin test")
sd_marker = request.node.get_closest_marker("sd_card")
if sd_marker and not _raw_client.features.sd_card_present:
raise RuntimeError(
@ -501,10 +507,6 @@ def pytest_runtest_setup(item: pytest.Item) -> None:
if not models_filter:
raise RuntimeError("Don't skip tests for all trezor models!")
skip_altcoins = int(os.environ.get("TREZOR_PYTEST_SKIP_ALTCOINS", 0))
if item.get_closest_marker("altcoin") and skip_altcoins:
pytest.skip("Skipping altcoin test")
def pytest_set_filtered_exceptions():
return (Timeout, protocol.UnexpectedMagic)