1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

ci: add duration timestamps on all test jobs

This commit is contained in:
vdovhanych 2021-06-07 12:33:02 +02:00 committed by matejcik
parent ae831abb75
commit 6b3e743373
3 changed files with 31 additions and 30 deletions

View File

@ -66,6 +66,7 @@ stdenv.mkDerivation ({
rustStable rustStable
wget wget
zlib zlib
moreutils
] ++ lib.optionals (!stdenv.isDarwin) [ ] ++ lib.optionals (!stdenv.isDarwin) [
procps procps
valgrind valgrind

View File

@ -29,8 +29,8 @@ hardware core regular device test:
- source hardware.cfg - source hardware.cfg
- set +a - set +a
- nix-shell --run "cd ../.. && poetry install" - nix-shell --run "cd ../.. && poetry install"
- nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin | ts -s"
- nix-shell --run "poetry run pytest -m 'altcoin and not sd_card' $TESTS_SKIP ../../tests/device_tests" - nix-shell --run "poetry run pytest -m 'altcoin and not sd_card' $TESTS_SKIP ../../tests/device_tests | ts -s"
timeout: 4h timeout: 4h
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
@ -59,8 +59,8 @@ hardware core btconly device test:
- source hardware.cfg - source hardware.cfg
- set +a - set +a
- nix-shell --run "cd ../.. && poetry install" - nix-shell --run "cd ../.. && poetry install"
- nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin | ts -s"
- nix-shell --run "poetry run pytest -m 'not sd_card' $TESTS_SKIP ../../tests/device_tests" - nix-shell --run "poetry run pytest -m 'not sd_card' $TESTS_SKIP ../../tests/device_tests | ts -s"
timeout: 4h timeout: 4h
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
@ -86,8 +86,8 @@ hardware core monero test:
- source hardware.cfg - source hardware.cfg
- set +a - set +a
- nix-shell --run "cd ../.. && poetry install" - nix-shell --run "cd ../.. && poetry install"
- nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin" - nix-shell --run "poetry run python bootstrap.py tt ../../trezor-*.bin | ts -s"
- nix-shell --arg fullDeps true --run "cd ../../core/tests && ./run_tests_device_emu_monero.sh $TESTOPTS" - nix-shell --arg fullDeps true --run "cd ../../core/tests && ./run_tests_device_emu_monero.sh $TESTOPTS | ts -s"
timeout: 1h timeout: 1h
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
@ -108,7 +108,7 @@ hardware legacy regular device test:
- legacy fw regular debug build - legacy fw regular debug build
script: script:
- cd ci/hardware_tests - cd ci/hardware_tests
- nix-shell --run "./t1_hw_test.sh" - nix-shell --run "./t1_hw_test.sh | ts -s"
timeout: 1h10m timeout: 1h10m
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
@ -133,7 +133,7 @@ hardware legacy btconly device test:
- legacy fw btconly debug build - legacy fw btconly debug build
script: script:
- cd ci/hardware_tests - cd ci/hardware_tests
- nix-shell --run "./t1_hw_test.sh" - nix-shell --run "./t1_hw_test.sh | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:

View File

@ -7,17 +7,17 @@ core unit test:
needs: needs:
- core unix regular build - core unix regular build
script: script:
- nix-shell --run "poetry run make -C core test" - nix-shell --run "poetry run make -C core test | ts -s"
core device ui test: core device ui test:
stage: test stage: test
needs: needs:
- core unix frozen debug build - core unix frozen debug build
script: script:
- nix-shell --run "poetry run make -C core test_emu_ui" - nix-shell --run "poetry run make -C core test_emu_ui | ts -s"
after_script: after_script:
- mv tests/ui_tests/reporting/reports/test/ test_ui_report - mv tests/ui_tests/reporting/reports/test/ test_ui_report
- nix-shell --run "poetry run python ci/prepare_ui_artifacts.py" - nix-shell --run "poetry run python ci/prepare_ui_artifacts.py | ts -s"
- diff tests/ui_tests/fixtures.json tests/ui_tests/fixtures.suggestion.json - diff tests/ui_tests/fixtures.json tests/ui_tests/fixtures.suggestion.json
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
@ -40,7 +40,7 @@ core device test:
variables: variables:
TREZOR_PROFILING: 1 TREZOR_PROFILING: 1
script: script:
- nix-shell --run "poetry run make -C core test_emu" - nix-shell --run "poetry run make -C core test_emu | ts -s"
- mv core/src/.coverage core/.coverage.test_emu - mv core/src/.coverage core/.coverage.test_emu
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
@ -61,7 +61,7 @@ core btconly device test:
MICROPYTHON: "build/unix/trezor-emu-core-bitcoinonly" MICROPYTHON: "build/unix/trezor-emu-core-bitcoinonly"
TREZOR_PYTEST_SKIP_ALTCOINS: 1 TREZOR_PYTEST_SKIP_ALTCOINS: 1
script: script:
- nix-shell --run "poetry run make -C core test_emu" - nix-shell --run "poetry run make -C core test_emu | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -79,7 +79,7 @@ core monero test:
variables: variables:
TREZOR_PROFILING: 1 TREZOR_PROFILING: 1
script: script:
- nix-shell --arg fullDeps true --run "poetry run make -C core test_emu_monero" - nix-shell --arg fullDeps true --run "poetry run make -C core test_emu_monero | ts -s"
- mv core/src/.coverage core/.coverage.test_emu_monero - mv core/src/.coverage core/.coverage.test_emu_monero
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
@ -97,8 +97,8 @@ core u2f test:
variables: variables:
TREZOR_PROFILING: 1 TREZOR_PROFILING: 1
script: script:
- nix-shell --run "poetry run make -C tests/fido_tests/u2f-tests-hid" - nix-shell --run "poetry run make -C tests/fido_tests/u2f-tests-hid | ts -s"
- nix-shell --run "poetry run make -C core test_emu_u2f" - nix-shell --run "poetry run make -C core test_emu_u2f | ts -s"
- mv core/src/.coverage core/.coverage.test_emu_u2f - mv core/src/.coverage core/.coverage.test_emu_u2f
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
@ -116,7 +116,7 @@ core fido2 test:
TREZOR_PROFILING: 1 TREZOR_PROFILING: 1
script: script:
- pgrep trezor-emu-core || true - pgrep trezor-emu-core || true
- nix-shell --run "poetry run make -C core test_emu_fido2" - nix-shell --run "poetry run make -C core test_emu_fido2 | ts -s"
- pgrep trezor-emu-core || true - pgrep trezor-emu-core || true
- mv core/src/.coverage core/.coverage.test_emu_fido2 - mv core/src/.coverage core/.coverage.test_emu_fido2
artifacts: artifacts:
@ -135,7 +135,7 @@ core click test:
needs: needs:
- core unix frozen debug build - core unix frozen debug build
script: script:
- nix-shell --run "poetry run make -C core test_emu_click" - nix-shell --run "poetry run make -C core test_emu_click | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -154,7 +154,7 @@ core upgrade test:
TREZOR_UPGRADE_TEST: "core" TREZOR_UPGRADE_TEST: "core"
script: script:
- nix-shell --run "tests/download_emulators.sh" - nix-shell --run "tests/download_emulators.sh"
- nix-shell --run "poetry run pytest --junitxml=tests/junit.xml tests/upgrade_tests" - nix-shell --run "poetry run pytest --junitxml=tests/junit.xml tests/upgrade_tests | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -169,7 +169,7 @@ core persistence test:
needs: needs:
- core unix frozen debug build - core unix frozen debug build
script: script:
- nix-shell --run "poetry run pytest --junitxml=tests/junit.xml tests/persistence_tests" - nix-shell --run "poetry run pytest --junitxml=tests/junit.xml tests/persistence_tests | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -195,8 +195,8 @@ crypto test:
- ./crypto/tests/aestst - ./crypto/tests/aestst
- ./crypto/tests/test_check - ./crypto/tests/test_check
- ./crypto/tests/test_openssl 1000 - ./crypto/tests/test_openssl 1000
- nix-shell --run "cd crypto && ITERS=10 poetry run pytest --junitxml=tests/junit.xml tests" - nix-shell --run "cd crypto && ITERS=10 poetry run pytest --junitxml=tests/junit.xml tests | ts -s"
- nix-shell --run "CK_TIMEOUT_MULTIPLIER=20 valgrind -q --error-exitcode=1 ./crypto/tests/test_check" - nix-shell --run "CK_TIMEOUT_MULTIPLIER=20 valgrind -q --error-exitcode=1 ./crypto/tests/test_check | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -216,7 +216,7 @@ legacy test:
variables: variables:
EMULATOR: "1" EMULATOR: "1"
script: script:
- nix-shell --run "poetry run legacy/script/test" - nix-shell --run "poetry run legacy/script/test | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -235,7 +235,7 @@ legacy btconly test:
EMULATOR_BINARY: "firmware/trezor-bitcoinonly.elf" EMULATOR_BINARY: "firmware/trezor-bitcoinonly.elf"
TREZOR_PYTEST_SKIP_ALTCOINS: 1 TREZOR_PYTEST_SKIP_ALTCOINS: 1
script: script:
- nix-shell --run "poetry run legacy/script/test" - nix-shell --run "poetry run legacy/script/test | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -254,7 +254,7 @@ legacy upgrade test:
TREZOR_UPGRADE_TEST: "legacy" TREZOR_UPGRADE_TEST: "legacy"
script: script:
- nix-shell --run "tests/download_emulators.sh" - nix-shell --run "tests/download_emulators.sh"
- nix-shell --run "poetry run pytest --junitxml=tests/junit.xml tests/upgrade_tests" - nix-shell --run "poetry run pytest --junitxml=tests/junit.xml tests/upgrade_tests | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -290,7 +290,7 @@ python test:
# See also: # See also:
# https://github.com/NixOS/nixpkgs/blob/b00c7c2d1d905eb63c81a0917f1a94b763a7843b/pkgs/development/interpreters/python/cpython/default.nix#L103 # https://github.com/NixOS/nixpkgs/blob/b00c7c2d1d905eb63c81a0917f1a94b763a7843b/pkgs/development/interpreters/python/cpython/default.nix#L103
# https://github.com/NixOS/nixpkgs/pull/98915 # https://github.com/NixOS/nixpkgs/pull/98915
- nix-shell --arg fullDeps true --run "unset _PYTHON_SYSCONFIGDATA_NAME && cd python && poetry run tox" - nix-shell --arg fullDeps true --run "unset _PYTHON_SYSCONFIGDATA_NAME && cd python && poetry run tox | ts -s"
# Storage # Storage
@ -304,8 +304,8 @@ storage test:
- storage/**/* - storage/**/*
needs: [] needs: []
script: script:
- nix-shell --run "poetry run make -C storage/tests build" - nix-shell --run "poetry run make -C storage/tests build | ts -s"
- nix-shell --run "poetry run make -C storage/tests tests_all" - nix-shell --run "poetry run make -C storage/tests tests_all | ts -s"
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
@ -326,8 +326,8 @@ core unix memory profiler:
TREZOR_MEMPERF: "1" TREZOR_MEMPERF: "1"
PYTEST_TIMEOUT: "900" PYTEST_TIMEOUT: "900"
script: script:
- nix-shell --run "poetry run make -C core build_unix_frozen" - nix-shell --run "poetry run make -C core build_unix_frozen | ts -s"
- nix-shell --run "poetry run make -C core test_emu" - nix-shell --run "poetry run make -C core test_emu | ts -s"
- nix-shell --run "mkdir core/prof/memperf-html" - nix-shell --run "mkdir core/prof/memperf-html"
- nix-shell --run "poetry run core/tools/alloc.py --alloc-data=core/src/alloc_data.txt html core/prof/memperf-html" - nix-shell --run "poetry run core/tools/alloc.py --alloc-data=core/src/alloc_data.txt html core/prof/memperf-html"
artifacts: artifacts: