2021-12-03 16:09:00 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Cloning connect repository and running the tests from there
|
|
|
|
|
|
|
|
FILE_DIR="$(dirname "${0}")"
|
|
|
|
cd ${FILE_DIR}
|
|
|
|
|
|
|
|
CONNECT_DIR="connect"
|
|
|
|
|
|
|
|
# For quicker local usage, do not cloning connect repo if it already exists
|
|
|
|
if [[ ! -d "${CONNECT_DIR}" ]]
|
|
|
|
then
|
|
|
|
git clone https://github.com/trezor/connect.git
|
|
|
|
cd ${CONNECT_DIR}
|
|
|
|
git submodule update --init --recursive
|
|
|
|
else
|
|
|
|
cd ${CONNECT_DIR}
|
|
|
|
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"
|
|
|
|
sed -i 's/localhost/127.0.0.1/g' ./tests/websocket-client.js
|
|
|
|
|
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-03-07 09:59:10 +00:00
|
|
|
nix-shell --run "yarn && tests/run.sh -d -f ${EMU_VERSION} -s 'yarn test:integration methods'"
|