Skip to content

Commit

Permalink
chore(tests): add emulator-branch possibilities into connect docker t…
Browse files Browse the repository at this point in the history
…ests
  • Loading branch information
grdddj authored and mroz22 committed Dec 9, 2024
1 parent ad75505 commit cd414ec
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion docker/docker-connect-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ show_usage() {
echo " -e All methods except excluded, example: applySettings,signTransaction"
echo " -p Test pattern"
echo " -f Use specific firmware version, example: 2.1.4, 1.8.0 default: -main"
echo " -b Use specific firmware branch"
echo " -o Use BTC-only firmware of the specified branch"
echo " -i Included methods only, example: applySettings,signTransaction"
echo " -s actual test script. default: 'yarn test:integration'"
echo " -u Firmware url"
Expand All @@ -46,6 +48,8 @@ show_usage() {
# default options
FIRMWARE=""
FIRMWARE_URL=""
FIRMWARE_BRANCH=""
FIRMWARE_BTC_ONLY=false
INCLUDED_METHODS=""
EXCLUDED_METHODS=""
DOCKER=true
Expand All @@ -59,7 +63,7 @@ TRANSPORT="2.0.33"
# echo $OPTARG
# user options
OPTIND=2
while getopts ":p:i:e:f:u:m:t:hdcr" opt; do
while getopts ":p:i:e:f:b:u:m:t:hdcro" opt; do
case $opt in
d)
DOCKER=false
Expand All @@ -71,6 +75,9 @@ while getopts ":p:i:e:f:u:m:t:hdcr" opt; do
f)
FIRMWARE=$OPTARG
;;
b)
FIRMWARE_BRANCH=$OPTARG
;;
u)
FIRMWARE_URL=$OPTARG
;;
Expand All @@ -83,6 +90,9 @@ while getopts ":p:i:e:f:u:m:t:hdcr" opt; do
p)
PATTERN=$OPTARG
;;
o)
FIRMWARE_BTC_ONLY=true
;;
m)
FIRMWARE_MODEL=$OPTARG
;;
Expand Down Expand Up @@ -110,6 +120,11 @@ else
SCRIPT="yarn workspace @trezor/connect test:e2e:web"
fi

if [[ $FIRMWARE_BTC_ONLY == true && -z $FIRMWARE_BRANCH ]]; then
echo "BTC-only firmware requires a branch to be specified"
exit 1
fi

# export essential process.env variables
export TESTS_FIRMWARE=$FIRMWARE
export TESTS_INCLUDED_METHODS=$INCLUDED_METHODS
Expand All @@ -119,6 +134,8 @@ export TESTS_USE_WS_CACHE=$USE_WS_CACHE
export TESTS_PATTERN=$PATTERN
export TESTS_SCRIPT=$SCRIPT
export TESTS_FIRMWARE_URL=$FIRMWARE_URL
export TESTS_FIRMWARE_BRANCH=$FIRMWARE_BRANCH
export TESTS_FIRMWARE_BTC_ONLY=$FIRMWARE_BTC_ONLY
export TESTS_FIRMWARE_MODEL=$FIRMWARE_MODEL
export TESTS_RANDOM=$RANDOMIZE
export TESTS_TRANSPORT=$TRANSPORT
Expand All @@ -133,6 +150,8 @@ run() {
echo " Firmware: ${TESTS_FIRMWARE}"
echo " Firmware model: ${TESTS_FIRMWARE_MODEL}"
echo " Firmware from url: ${FIRMWARE_URL}"
echo " Firmware from branch: ${FIRMWARE_BRANCH}"
echo " Firmware BTC-only: ${FIRMWARE_BTC_ONLY}"
echo " Test pattern: $PATTERN"
echo " Included methods: ${INCLUDED_METHODS}"
echo " Excluded methods: ${EXCLUDED_METHODS}"
Expand Down

0 comments on commit cd414ec

Please sign in to comment.