diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 393c1df15..04e4a6973 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,5 +38,6 @@ include: - ci/prebuild.yml - ci/build.yml - ci/test.yml + - ci/test-hw.yml - ci/posttest.yml - ci/deploy.yml diff --git a/ci/test-hw.yml b/ci/test-hw.yml new file mode 100644 index 000000000..c930f54b5 --- /dev/null +++ b/ci/test-hw.yml @@ -0,0 +1,121 @@ +image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/trezor-firmware-env.nix + +# Hardware + +hardware core regular device test: + stage: test + only: + - schedules # nightly build + - /^legacy\// + - /^release\// + - /^secfix\// + - /^hw\// + tags: + - tpmb + needs: + - core fw regular debug build + variables: + PYTEST_TIMEOUT: "1200" + TESTS_SKIP: "-k 'not 15_of_15 and not test_multisig_mismatch_inputs and not test_sign_tx'" + script: + - cd ci/hardware_tests + - set -a + - source hardware.cfg + - set +a + - nix-shell --run "cd ../.. && poetry install" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest --random-order-bucket=none -x -m 'altcoin' ../../tests/device_tests/test_msg_[a-r]*.py" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest --random-order-bucket=none -x -m 'altcoin' ../../tests/device_tests/test_msg_[s-z]*.py ../../tests/device_tests/test_[^m]*.py ../../tests/device_tests/test_m[^s]*.py" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest --random-order-bucket=none -x -m 'not altcoin' $TESTS_SKIP ../../tests/device_tests/test_[^m]*.py" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest --random-order-bucket=none -x -m 'not altcoin' $TESTS_SKIP ../../tests/device_tests/test_m[^s]*.py" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest --random-order-bucket=none -x -m 'not altcoin' $TESTS_SKIP ../../tests/device_tests/test_msg_[a-r]*.py" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest --random-order-bucket=none -x -m 'not altcoin' $TESTS_SKIP ../../tests/device_tests/test_msg_signt*.py" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest --random-order-bucket=none -x -m 'not altcoin' $TESTS_SKIP ../../tests/device_tests/test_msg_sign[^t]*.py ../../tests/device_tests/test_msg_s[^i]*.py" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest --random-order-bucket=none -x -m 'not altcoin' $TESTS_SKIP ../../tests/device_tests/test_msg_[t-z]*.py" + timeout: 4h + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + expire_in: 2 days + when: always + +hardware core btconly device test: + stage: test + only: + - schedules # nightly build + - /^legacy\// + - /^release\// + - /^secfix\// + - /^hw\// + tags: + - tpmb + needs: + - core fw btconly debug build + variables: + TREZOR_PYTEST_SKIP_ALTCOINS: 1 + PYTEST_TIMEOUT: "1200" + script: + - cd ci/hardware_tests + - set -a + - source hardware.cfg + - set +a + - nix-shell --run "cd ../.. && poetry install" + - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" + - nix-shell --run "poetry run pytest -x ../../tests/device_tests -k 'not 15_of_15 and not test_multisig_mismatch_inputs'" + timeout: 4h + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + expire_in: 2 days + when: always + +hardware legacy regular device test: + stage: test + only: + - schedules # nightly build + - /^legacy\// + - /^release\// + - /^secfix\// + - /^hw\// + tags: + - tpmb + needs: + - legacy fw regular debug build + script: + - cd ci/hardware_tests + - nix-shell --run "./t1_hw_test.sh" + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - ci/hardware_tests/*.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\// + - /^secfix\// + - /^hw\// + tags: + - tpmb + needs: + - legacy fw btconly debug build + script: + - cd ci/hardware_tests + - nix-shell --run "./t1_hw_test.sh" + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - ci/hardware_tests/*.mp4 + expire_in: 2 days + when: always diff --git a/ci/test.yml b/ci/test.yml index cbc9d9d6d..d01ae690b 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -305,83 +305,6 @@ storage test: expire_in: 1 week when: always -# Hardware - -hardware core btconly device test: - stage: test - only: - - schedules # nightly build - - /^legacy\// - - /^release\// - - /^secfix\// - - /^hw\// - tags: - - tpmb - needs: - - core fw btconly debug build - variables: - TREZOR_PYTEST_SKIP_ALTCOINS: 1 - PYTEST_TIMEOUT: "1200" - script: - - cd ci/hardware_tests - - set -a - - source hardware.cfg - - set +a - - nix-shell --run "cd ../.. && poetry install" - - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" - - nix-shell --run "poetry run pytest ../../tests/device_tests -m 'not sd_card' -k 'not 15_of_15 and not test_multisig_mismatch_inputs'" - timeout: 4h - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - expire_in: 2 days - when: always - -hardware legacy regular device test: - stage: test - only: - - schedules # nightly build - - /^legacy\// - - /^release\// - - /^secfix\// - - /^hw\// - tags: - - tpmb - needs: - - legacy fw regular debug build - script: - - cd ci/hardware_tests - - nix-shell --run "./t1_hw_test.sh" - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - paths: - - ci/hardware_tests/*.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\// - - /^secfix\// - - /^hw\// - tags: - - tpmb - needs: - - legacy fw btconly debug build - script: - - cd ci/hardware_tests - - nix-shell --run "./t1_hw_test.sh" - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - paths: - - ci/hardware_tests/*.mp4 - expire_in: 2 days - when: always - # Memory profiling core unix memory profiler: