Skip to content

Commit

Permalink
ci: add hwi tests for core and legacy builds
Browse files Browse the repository at this point in the history
  • Loading branch information
vdovhanych committed Feb 3, 2022
1 parent 3536d86 commit 26538ab
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ci/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 26 additions & 0 deletions ci/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 26538ab

Please sign in to comment.