1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-30 11:28:21 +00:00
trezor-firmware/ci/test.yml

354 lines
8.3 KiB
YAML
Raw Normal View History

2020-06-07 19:49:06 +00:00
image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/trezor-firmware-env.nix
# Core
2020-02-24 11:26:03 +00:00
core unit test:
stage: test
dependencies:
- core unix regular build
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C core test"
2020-02-24 11:26:03 +00:00
core device ui test:
2019-12-09 16:01:04 +00:00
stage: test
dependencies:
- core unix frozen debug build
2019-12-09 16:01:04 +00:00
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C core test_emu_ui"
after_script:
- mv tests/ui_tests/reporting/reports/test/ test_ui_report
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run python ci/prepare_ui_artifacts.py"
2019-12-09 16:01:04 +00:00
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
2019-12-09 16:01:04 +00:00
paths:
- ci/ui_test_records/
- test_ui_report
- tests/ui_tests/screens/
2020-01-07 11:53:50 +00:00
- tests/junit.xml
2020-01-16 16:17:41 +00:00
- tests/trezor.log
when: always
2019-12-09 16:01:04 +00:00
expire_in: 1 week
2020-01-07 11:53:50 +00:00
reports:
junit: tests/junit.xml
2019-12-09 16:01:04 +00:00
2020-02-24 11:26:03 +00:00
core device test:
stage: test
dependencies:
- core unix frozen debug build
variables:
TREZOR_PROFILING: 1
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C core test_emu"
- mv core/src/.coverage core/.coverage.test_emu
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
2020-01-16 16:17:41 +00:00
- tests/trezor.log
- tests/junit.xml
- core/.coverage.*
expire_in: 1 week
when: always
reports:
junit: tests/junit.xml
2020-02-24 11:26:03 +00:00
core btconly device test:
2019-08-22 18:18:44 +00:00
stage: test
dependencies:
- core unix frozen btconly debug build
2019-08-22 18:18:44 +00:00
variables:
2020-01-16 14:42:41 +00:00
MICROPYTHON: "build/unix/micropython-bitcoinonly"
2019-08-22 18:18:44 +00:00
TREZOR_PYTEST_SKIP_ALTCOINS: 1
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C core test_emu"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
2020-01-16 16:17:41 +00:00
- tests/trezor.log
- tests/junit.xml
expire_in: 1 week
when: always
reports:
junit: tests/junit.xml
2019-08-22 18:18:44 +00:00
2020-02-24 11:26:03 +00:00
core monero test:
stage: test
dependencies:
- core unix frozen debug build
variables:
TREZOR_PROFILING: 1
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C core test_emu_monero"
- mv core/src/.coverage core/.coverage.test_emu_monero
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
2020-01-16 16:17:41 +00:00
- tests/trezor.log
- core/.coverage.*
expire_in: 1 week
when: always
2020-02-24 11:26:03 +00:00
core u2f test:
2019-09-14 12:47:30 +00:00
stage: test
dependencies:
- core unix frozen debug build
variables:
TREZOR_PROFILING: 1
2019-09-14 12:47:30 +00:00
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C tests/fido_tests/u2f-tests-hid"
- nix-shell --run "pipenv run make -C core test_emu_u2f"
- mv core/src/.coverage core/.coverage.test_emu_u2f
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
2020-01-16 16:17:41 +00:00
- tests/trezor.log
- core/.coverage.*
expire_in: 1 week
when: always
2019-09-14 12:47:30 +00:00
2020-02-24 11:26:03 +00:00
core fido2 test:
2019-10-18 13:35:45 +00:00
stage: test
dependencies:
- core unix frozen debug build
variables:
TREZOR_PROFILING: 1
2019-10-18 13:35:45 +00:00
script:
- pgrep micropython || true
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C core test_emu_fido2"
- pgrep micropython || true
- mv core/src/.coverage core/.coverage.test_emu_fido2
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
2020-01-16 16:17:41 +00:00
- tests/trezor.log
- tests/junit.xml
- core/.coverage.*
expire_in: 1 week
reports:
junit: tests/junit.xml
when: always
2019-10-18 13:35:45 +00:00
2020-02-24 11:26:03 +00:00
core click test:
2019-10-25 12:03:44 +00:00
stage: test
dependencies:
- core unix frozen debug build
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C core test_emu_click"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
2020-01-16 16:17:41 +00:00
- tests/trezor.log
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
when: always
2019-10-25 12:03:44 +00:00
2020-02-24 11:26:03 +00:00
core upgrade test:
stage: test
dependencies:
- core unix frozen debug build
variables:
TREZOR_UPGRADE_TEST: "core"
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "tests/download_emulators.sh"
- nix-shell --run "pipenv run pytest --junitxml=tests/junit.xml tests/upgrade_tests"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
when: always
2020-02-24 11:26:03 +00:00
core persistence test:
2019-10-25 12:03:44 +00:00
stage: test
dependencies:
- core unix frozen debug build
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run pytest --junitxml=tests/junit.xml tests/persistence_tests"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
when: always
2019-10-25 12:03:44 +00:00
# Crypto
crypto test:
stage: test
only:
changes:
- ci/**/*
- crypto/**/*
dependencies:
- crypto build
script:
2020-06-07 19:49:06 +00:00
- ./crypto/tests/aestst
- ./crypto/tests/test_check
- ./crypto/tests/test_openssl 1000
- nix-shell --run "cd crypto && ITERS=10 pipenv run pytest --junitxml=tests/junit.xml tests"
- nix-shell --run "CK_TIMEOUT_MULTIPLIER=20 valgrind -q --error-exitcode=1 ./crypto/tests/test_check"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
when: always
# Legacy
2020-02-24 11:26:03 +00:00
legacy test:
stage: test
dependencies:
- legacy emu regular build
variables:
EMULATOR: "1"
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run legacy/script/test"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
when: always
2020-02-24 11:26:03 +00:00
legacy btconly test:
2019-08-22 18:18:44 +00:00
stage: test
dependencies:
- legacy emu btconly build
2019-08-22 18:18:44 +00:00
variables:
EMULATOR: "1"
EMULATOR_BINARY: "firmware/trezor-bitcoinonly.elf"
TREZOR_PYTEST_SKIP_ALTCOINS: 1
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run legacy/script/test"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
when: always
2019-08-22 18:18:44 +00:00
2020-02-24 11:26:03 +00:00
legacy upgrade test:
stage: test
dependencies:
- legacy emu regular build
variables:
TREZOR_UPGRADE_TEST: "legacy"
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "tests/download_emulators.sh"
- nix-shell --run "pipenv run pytest --junitxml=tests/junit.xml tests/upgrade_tests"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
when: always
# Python
python test:
stage: test
2020-01-28 15:24:58 +00:00
dependencies: []
variables:
LC_ALL: "C.UTF-8"
LANG: "C.UTF-8"
only:
changes:
- ci/**/*
- common/**/*
- python/**/*
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "cd python && pipenv run tox"
# Storage
storage test:
stage: test
only:
changes:
- ci/**/*
- storage/**/*
dependencies: []
script:
2020-06-07 19:49:06 +00:00
- nix-shell --run "pipenv run make -C storage/tests build"
- nix-shell --run "pipenv run make -C storage/tests tests_all"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
when: always
# Hardware
hardware legacy regular device test:
stage: test
only:
- schedules # nightly build
- /^legacy\//
- /^release\//
tags:
- tpmb
dependencies:
- legacy fw regular debug build
script:
- cd ci/hardware_tests
- nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} start"
- nix-shell --run "cd ../.. && pipenv sync"
- nix-shell --run "pipenv run python bootstrap.py"
- nix-shell --run "pipenv run python bootstrap.py ../../trezor-*.bin"
- nix-shell --run "pipenv run pytest ../../tests/device_tests"
- nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} stop"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- ci/hardware_tests/video*.mp4
expire_in: 2 days
when: always
hardware legacy btconly device test:
stage: test
variables:
TREZOR_PYTEST_SKIP_ALTCOINS: 1
only:
- schedules # nightly build
- /^legacy\//
- /^release\//
tags:
- tpmb
dependencies:
- legacy fw btconly debug build
script:
- cd ci/hardware_tests
- nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} start"
- nix-shell --run "cd ../.. && pipenv sync"
- nix-shell --run "pipenv run python bootstrap.py"
- nix-shell --run "pipenv run python bootstrap.py ../../trezor-*.bin"
- nix-shell --run "pipenv run pytest ../../tests/device_tests"
- nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} stop"
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- ci/hardware_tests/video*.mp4
expire_in: 2 days
when: always