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

ci: add junit for a nice tests overview

This commit is contained in:
Tomas Susanka 2020-01-02 17:55:37 +00:00
parent a474ca40be
commit a28f29708f
7 changed files with 79 additions and 16 deletions

View File

@ -48,10 +48,13 @@ core unix device test:
- pipenv run make test_emu - pipenv run make test_emu
- cp /var/tmp/trezor.log ${CI_PROJECT_DIR} - cp /var/tmp/trezor.log ${CI_PROJECT_DIR}
artifacts: artifacts:
name: core-unix-device-test.log name: core-unix-device-test
paths: paths:
- trezor.log - trezor.log
- tests/junit.xml
expire_in: 1 week expire_in: 1 week
reports:
junit: tests/junit.xml
core unix btconly device test: core unix btconly device test:
stage: test stage: test
@ -66,10 +69,13 @@ core unix btconly device test:
- pipenv run make test_emu - pipenv run make test_emu
- cp /var/tmp/trezor.log ${CI_PROJECT_DIR} - cp /var/tmp/trezor.log ${CI_PROJECT_DIR}
artifacts: artifacts:
name: core-unix-btconly-device-test.log name: core-unix-btconly-device-test
paths: paths:
- trezor.log - trezor.log
- tests/junit.xml
expire_in: 1 week expire_in: 1 week
reports:
junit: tests/junit.xml
core unix monero test: core unix monero test:
stage: test stage: test
@ -81,7 +87,7 @@ core unix monero test:
- pipenv run make test_emu_monero - pipenv run make test_emu_monero
- cp /var/tmp/trezor.log ${CI_PROJECT_DIR} - cp /var/tmp/trezor.log ${CI_PROJECT_DIR}
artifacts: artifacts:
name: core-unix-monero-test.log name: core-unix-monero-test
paths: paths:
- trezor.log - trezor.log
expire_in: 1 week expire_in: 1 week
@ -98,7 +104,7 @@ core unix u2f test:
- pipenv run make test_emu_u2f - pipenv run make test_emu_u2f
- cp /var/tmp/trezor.log ${CI_PROJECT_DIR} - cp /var/tmp/trezor.log ${CI_PROJECT_DIR}
artifacts: artifacts:
name: core-unix-u2f-test.log name: core-unix-u2f-test
paths: paths:
- trezor.log - trezor.log
expire_in: 1 week expire_in: 1 week
@ -113,10 +119,13 @@ core unix fido2 test:
- pipenv run make test_emu_fido2 - pipenv run make test_emu_fido2
- cp /var/tmp/trezor.log ${CI_PROJECT_DIR} - cp /var/tmp/trezor.log ${CI_PROJECT_DIR}
artifacts: artifacts:
name: core-unix-fido2-test.log name: core-unix-fido2-test
paths: paths:
- trezor.log - trezor.log
- tests/junit.xml
expire_in: 1 week expire_in: 1 week
reports:
junit: tests/junit.xml
core unix click test: core unix click test:
stage: test stage: test
@ -128,9 +137,12 @@ core unix click test:
- pipenv run make test_emu_click - pipenv run make test_emu_click
- cp /var/tmp/trezor.log ${CI_PROJECT_DIR} - cp /var/tmp/trezor.log ${CI_PROJECT_DIR}
artifacts: artifacts:
name: core-unix-click-test.log name: core-unix-click-test
paths: paths:
- trezor.log - trezor.log
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week expire_in: 1 week
core unix upgrade test: core unix upgrade test:
@ -142,7 +154,14 @@ core unix upgrade test:
TREZOR_UPGRADE_TEST: "core" TREZOR_UPGRADE_TEST: "core"
script: script:
- tests/download_emulators.sh - tests/download_emulators.sh
- pipenv run pytest tests/upgrade_tests - pipenv run pytest --junitxml=tests/junit.xml tests/upgrade_tests
artifacts:
name: core-unix-upgrade-test
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
core unix persistence test: core unix persistence test:
stage: test stage: test
@ -150,7 +169,14 @@ core unix persistence test:
dependencies: dependencies:
- core unix frozen debug build - core unix frozen debug build
script: script:
- pipenv run pytest tests/persistence_tests - pipenv run pytest --junitxml=tests/junit.xml tests/persistence_tests
artifacts:
name: core-unix-persistence-test
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
core mypy test: core mypy test:
stage: test stage: test
@ -178,8 +204,15 @@ crypto test:
- ./tests/aestst - ./tests/aestst
- ./tests/test_check - ./tests/test_check
- ./tests/test_openssl 1000 - ./tests/test_openssl 1000
- ITERS=10 pipenv run pytest tests - ITERS=10 pipenv run pytest --junitxml=tests/junit.xml tests
- CK_TIMEOUT_MULTIPLIER=20 valgrind -q --error-exitcode=1 ./tests/test_check - CK_TIMEOUT_MULTIPLIER=20 valgrind -q --error-exitcode=1 ./tests/test_check
artifacts:
name: crypto-test
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
# Legacy # Legacy
@ -194,6 +227,13 @@ legacy emu test:
script: script:
- cd legacy - cd legacy
- pipenv run script/test - pipenv run script/test
artifacts:
name: legacy-emu-test
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
legacy emu btconly test: legacy emu btconly test:
stage: test stage: test
@ -207,6 +247,14 @@ legacy emu btconly test:
script: script:
- cd legacy - cd legacy
- pipenv run script/test - pipenv run script/test
artifacts:
name: legacy-emu-btconly-test
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
legacy emu upgrade test: legacy emu upgrade test:
stage: test stage: test
@ -217,7 +265,14 @@ legacy emu upgrade test:
TREZOR_UPGRADE_TEST: "legacy" TREZOR_UPGRADE_TEST: "legacy"
script: script:
- tests/download_emulators.sh - tests/download_emulators.sh
- pipenv run pytest tests/upgrade_tests - pipenv run pytest --junitxml=tests/junit.xml tests/upgrade_tests
artifacts:
name: legacy-emu-upgrade-test
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week
# Python # Python
@ -247,3 +302,10 @@ storage test:
- cd storage/tests - cd storage/tests
- pipenv run make build - pipenv run make build
- pipenv run make tests_all - pipenv run make tests_all
artifacts:
name: storage-test
paths:
- tests/junit.xml
reports:
junit: tests/junit.xml
expire_in: 1 week

View File

@ -31,7 +31,7 @@ fi
# run tests # run tests
error=0 error=0
if ! pytest ../../tests/click_tests "$@"; then if ! pytest --junitxml=../../tests/junit.xml ../../tests/click_tests "$@"; then
error=1 error=1
fi fi
kill $upy_pid kill $upy_pid

View File

@ -31,7 +31,7 @@ fi
# run tests # run tests
error=0 error=0
if ! pytest ../../tests/device_tests "$@"; then if ! pytest --junitxml=../../tests/junit.xml ../../tests/device_tests "$@"; then
error=1 error=1
fi fi
kill $upy_pid kill $upy_pid

View File

@ -33,7 +33,7 @@ cd ../../tests/fido_tests/fido2
# run tests # run tests
error=0 error=0
export TREZOR_FIDO2_UDP_PORT=21326 export TREZOR_FIDO2_UDP_PORT=21326
if ! pytest --sim tests/standard/ --vendor trezor "$@"; then if ! pytest --junitxml=../../tests/junit.xml --sim tests/standard/ --vendor trezor "$@"; then
error=1 error=1
fi fi
kill $upy_pid kill $upy_pid

View File

@ -16,4 +16,4 @@ if [ "$EMULATOR" = 1 ]; then
"${PYTHON:-python}" script/wait_for_emulator.py "${PYTHON:-python}" script/wait_for_emulator.py
fi fi
"${PYTHON:-python}" -m pytest ../tests/device_tests "$@" "${PYTHON:-python}" -m pytest --junitxml=../tests/junit.xml ../tests/device_tests "$@"

View File

@ -6,7 +6,7 @@ build:
## tests commands: ## tests commands:
tests: tests:
pytest -k "not hypothesis" pytest --junitxml=../../tests/junit.xml -k "not hypothesis"
tests_all: tests_all:
pytest pytest --junitxml=../../tests/junit.xml

1
tests/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
junit.xml