aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Stacey <markjstacey@gmail.com>2019-08-07 19:52:05 +0800
committerGitHub <noreply@github.com>2019-08-07 19:52:05 +0800
commit14e31cb9bec57fca470686e08437798a773ab6ff (patch)
tree8b5954a470617fab34b066a5166b8d1dae6bc5dd
parent86ad9564a064fd6158dab6a3c9e5b10614ef6e68 (diff)
downloadtangerine-wallet-browser-14e31cb9bec57fca470686e08437798a773ab6ff.tar.gz
tangerine-wallet-browser-14e31cb9bec57fca470686e08437798a773ab6ff.tar.zst
tangerine-wallet-browser-14e31cb9bec57fca470686e08437798a773ab6ff.zip
Allow overriding GANACHE_ARGS for e2e tests (#6970)
This allows the environment variable `GANACHE_ARGS` to override the default set of optional flags used. By default, the flag `--quiet` is set. Setting `GANACHE_ARGS` will override the default. For example, you can now run the e2e tests without the `--quiet` flag by running this: ```bash GANACHE_ARGS='' yarn test:e2e:chrome ``` This change also prevents the arguments from being needlessly repeated. Previously this script accidentally build up `GANACHE_ARGS`, adding to the set of flags used with each change in arguments. This PR is based upon #6870
-rwxr-xr-xtest/e2e/run-all.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/e2e/run-all.sh b/test/e2e/run-all.sh
index 0e3fdfcc4..cb161f0b8 100755
--- a/test/e2e/run-all.sh
+++ b/test/e2e/run-all.sh
@@ -5,8 +5,13 @@ set -e
set -u
set -o pipefail
+# Set the environment variable 'GANACHE_ARGS' to change any optional ganache flags
+# By default, the flag `--quiet` is used. Setting 'GANACHE_ARGS' will override the default.
+OPTIONAL_GANACHE_ARGS="${GANACHE_ARGS---quiet}"
+BASE_GANACHE_ARGS="${OPTIONAL_GANACHE_ARGS} --blockTime 2"
+
export PATH="$PATH:./node_modules/.bin"
-export GANACHE_ARGS='--blockTime 2 --quiet'
+export GANACHE_ARGS="${BASE_GANACHE_ARGS}"
concurrently --kill-others \
--names 'ganache,dapp,e2e' \
@@ -24,7 +29,7 @@ concurrently --kill-others \
'yarn dapp' \
'sleep 5 && mocha test/e2e/metamask-responsive-ui.spec'
-export GANACHE_ARGS="$GANACHE_ARGS --deterministic --account=0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9,25000000000000000000"
+export GANACHE_ARGS="${BASE_GANACHE_ARGS} --deterministic --account=0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9,25000000000000000000"
concurrently --kill-others \
--names 'ganache,e2e' \
--prefix '[{time}][{name}]' \
@@ -32,7 +37,7 @@ concurrently --kill-others \
'yarn ganache:start' \
'sleep 5 && mocha test/e2e/from-import-ui.spec'
-export GANACHE_ARGS="$GANACHE_ARGS --deterministic --account=0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9,25000000000000000000"
+export GANACHE_ARGS="${BASE_GANACHE_ARGS} --deterministic --account=0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9,25000000000000000000"
concurrently --kill-others \
--names 'ganache,e2e' \
--prefix '[{time}][{name}]' \
@@ -41,7 +46,7 @@ concurrently --kill-others \
'sleep 5 && mocha test/e2e/send-edit.spec'
-export GANACHE_ARGS="$GANACHE_ARGS --deterministic --account=0x250F458997A364988956409A164BA4E16F0F99F916ACDD73ADCD3A1DE30CF8D1,0 --account=0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9,25000000000000000000"
+export GANACHE_ARGS="${BASE_GANACHE_ARGS} --deterministic --account=0x250F458997A364988956409A164BA4E16F0F99F916ACDD73ADCD3A1DE30CF8D1,0 --account=0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9,25000000000000000000"
concurrently --kill-others \
--names 'ganache,sendwithprivatedapp,e2e' \
--prefix '[{time}][{name}]' \
@@ -50,7 +55,7 @@ concurrently --kill-others \
'npm run sendwithprivatedapp' \
'sleep 5 && mocha test/e2e/incremental-security.spec'
-export GANACHE_ARGS="$GANACHE_ARGS --deterministic --account=0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9,25000000000000000000"
+export GANACHE_ARGS="${BASE_GANACHE_ARGS} --deterministic --account=0x53CB0AB5226EEBF4D872113D98332C1555DC304443BEE1CF759D15798D3C55A9,25000000000000000000"
concurrently --kill-others \
--names 'ganache,dapp,e2e' \
--prefix '[{time}][{name}]' \