2021-12-03 16:09:00 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-08-03 06:49:51 +00:00
|
|
|
# Cloning trezor-suite repository and running connect tests from there
|
2021-12-03 16:09:00 +00:00
|
|
|
|
|
|
|
FILE_DIR="$(dirname "${0}")"
|
|
|
|
cd ${FILE_DIR}
|
|
|
|
|
2022-08-03 06:49:51 +00:00
|
|
|
TREZOR_SUITE_DIR="trezor-suite"
|
2021-12-03 16:09:00 +00:00
|
|
|
|
|
|
|
# For quicker local usage, do not cloning connect repo if it already exists
|
2022-08-03 06:49:51 +00:00
|
|
|
if [[ ! -d "${TREZOR_SUITE_DIR}" ]]
|
2021-12-03 16:09:00 +00:00
|
|
|
then
|
2022-08-03 06:49:51 +00:00
|
|
|
git clone https://github.com/trezor/trezor-suite.git
|
|
|
|
cd ${TREZOR_SUITE_DIR}
|
2021-12-03 16:09:00 +00:00
|
|
|
git submodule update --init --recursive
|
|
|
|
else
|
2022-08-03 06:49:51 +00:00
|
|
|
cd ${TREZOR_SUITE_DIR}
|
2021-12-03 16:09:00 +00:00
|
|
|
fi
|
|
|
|
|
2022-06-30 11:47:02 +00:00
|
|
|
echo "Changing 'localhost' to '127.0.0.1' in websocket client as a workaround for CI servers"
|
2022-08-03 06:49:51 +00:00
|
|
|
sed -i 's/localhost/127.0.0.1/g' ./packages/integration-tests/websocket-client.js
|
2022-06-30 11:47:02 +00:00
|
|
|
|
2021-12-03 16:09:00 +00:00
|
|
|
# Taking an optional script argument with emulator version
|
|
|
|
if [ ! -z "${1}" ]
|
|
|
|
then
|
|
|
|
EMU_VERSION="${1}"
|
|
|
|
else
|
|
|
|
EMU_VERSION="2-master"
|
|
|
|
fi
|
|
|
|
echo "Will be running with ${EMU_VERSION} emulator"
|
|
|
|
|
|
|
|
# Using -d flag to disable docker, as tenv is already running on the background
|
2022-09-08 06:46:27 +00:00
|
|
|
nix-shell --run "yarn && yarn build:libs && ./docker/docker-connect-test.sh node -p methods -d -c -f ${EMU_VERSION} -e checkFirmwareAuthenticity"
|