From 26538abce7c17bc9ceca44b3beda10ca051d523b Mon Sep 17 00:00:00 2001 From: vdovhanych Date: Thu, 20 Jan 2022 16:05:06 +0100 Subject: [PATCH] ci: add hwi tests for core and legacy builds --- ci/shell.nix | 12 ++++++++++++ ci/test.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/ci/shell.nix b/ci/shell.nix index 52da2d6f536..44ba5f61c7c 100644 --- a/ci/shell.nix +++ b/ci/shell.nix @@ -41,11 +41,23 @@ let llvmPackages = nixpkgs.llvmPackages_12; # see pyright/README.md for update procedure pyright = nixpkgs.callPackage ./pyright {}; + # HWI tests need https://github.com/bitcoin/bitcoin/pull/22558 + # remove this once nixpkgs version contains this patch + bitcoind = (nixpkgs.bitcoind.overrideAttrs (attrs: { + version = attrs.version + "-taproot-psbt"; + src = nixpkgs.fetchFromGitHub { + owner = "achow101"; + repo = "bitcoin"; + rev = "taproot-psbt"; + sha256 = "sha256-Am7SVxOTlTUjESk8O7kziwyV2GaBX6pGB1oksYPc1EE="; + }; + })); in with nixpkgs; stdenvNoCC.mkDerivation ({ name = "trezor-firmware-env"; buildInputs = lib.optionals fullDeps [ + bitcoind # install other python versions for tox testing # NOTE: running e.g. "python3" in the shell runs the first version in the following list, # and poetry uses the default version (currently 3.8) diff --git a/ci/test.yml b/ci/test.yml index 45337e60d07..c5a8a1f3e48 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -374,6 +374,18 @@ core persistence asan test: expire_in: 1 week when: always +core hwi test: + stage: test + <<: *gitlab_caching + needs: + - core unix frozen debug build + script: + - nix-shell --run "git clone https://github.com/bitcoin-core/HWI.git" + - nix-shell --arg fullDeps true --run "cd HWI && poetry install && poetry run ./test/test_trezor.py --model_t ../core/build/unix/trezor-emu-core bitcoind" + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - HWI/trezor-t-emulator.stdout # Crypto @@ -512,6 +524,20 @@ legacy upgrade asan test: expire_in: 1 week when: always +legacy hwi test: + stage: test + <<: *gitlab_caching + needs: + - legacy emu regular debug build + variables: + EMULATOR: "1" + script: + - nix-shell --run "git clone https://github.com/bitcoin-core/HWI.git" + - nix-shell --arg fullDeps true --run "cd HWI && poetry install && poetry run ./test/test_trezor.py --model_1 ../legacy/firmware/trezor.elf bitcoind" + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - HWI/trezor-1-emulator.stdout # Python