diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c1df0d3b7..4182410f3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,5 @@ version: 2.1 -aliases: - # Define paths and never think about them again - - &WORKSPACE /tmp/lunie - # reusable commands commands: yarn-install: @@ -11,7 +7,7 @@ commands: steps: - restore_cache: keys: - - v4-dependencies-root-{{ checksum "package.json" }} + - v4-dependencies-root-{{ checksum "yarn.lock" }} - v4-dependencies-root- - run: yarn install @@ -19,7 +15,20 @@ commands: paths: - yarn.lock - node_modules - key: v4-dependencies-root-{{ checksum "package.json" }} + key: v4-dependencies-root-{{ checksum "yarn.lock" }} + npm-install-app: + description: '[NPM] update and install' + steps: + - restore_cache: + keys: + - v1-dependencies-app-root-{{ checksum "lunie/yarn.lock" }} + - v1-dependencies-app-root- + + - run: cd lunie && npm install + - save_cache: + paths: + - lunie/node_modules + key: v1-dependencies-app-root-{{ checksum "lunie/yarn.lock" }} jobs: pendingUpdated: @@ -83,24 +92,36 @@ jobs: exit 0 testE2E: - docker: - # Primary container image where all steps run. - - image: circleci/node:10.15.3-browsers - # Secondary container image on common network which runs the testnet - - image: lunieio/testnet:v0.34.3 + machine: true steps: + - add_ssh_keys: + fingerprints: + - "65:5f:43:fd:be:48:c8:45:d5:39:ef:86:14:d6:e1:12" - checkout - - attach_workspace: - at: *WORKSPACE - - yarn-install - - setup_remote_docker + - run: npm install - run: - name: Build + name: Add GitHub to known hosts command: | - npm run initiate-submodule - npm run test:e2e:build - cd lunie - yarn certificates + mkdir -p ~/.ssh + touch ~/.ssh/known_hosts + ssh-keygen -R github.com + ssh-keyscan github.com >> ~/.ssh/known_hosts + - run: + name: checkout backend + command: | + git clone git@github.com:luniehq/lunie-backend.git + cd lunie-backend + git checkout origin/develop + - run: + name: Use NVM + command: | + echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV + echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV + - run: + name: Install node version + command: | + nvm install v10.13.0 + nvm alias default v10.13.0 - run: name: Install Chrome command: | @@ -108,9 +129,32 @@ jobs: sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' sudo apt-get update sudo apt-get -y install google-chrome-stable + - run: + name: Run testnet + command: | + cd lunie-backend + docker-compose up --build -d + - run: + # needs to be done in CI to be sure it is build once we start the tests + name: Build Extension + command: | + npm run initiate-submodule + npm run test:e2e:build + environment: + VUE_APP_GRAPHQL_URL: http://127.0.0.1:4000 # Browserstack tunneling doesn't work with "localhost" + - npm-install-app + - run: + # needs to be done in CI to be sure it is build once we start the tests + name: Build App + command: | + cd lunie + npm run test:e2e:build + environment: + NETWORK: local-cosmos-hub-testnet + VUE_APP_GRAPHQL_URL: http://127.0.0.1:4000 # Browserstack tunneling doesn't work with "localhost" - run: name: Test - command: npm run test:e2e:start-lunie & yarn test:e2e + command: npm run test:e2e:start-lunie & npm run test:e2e no_output_timeout: 120 - store_artifacts: path: ./screenshots diff --git a/.gitignore b/.gitignore index 88cef4d655..87ca262208 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /lunie /test/unit/coverage /output +/screenshots \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 2b2bfd29be..f0ba59f865 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "lunie"] path = lunie url = https://github.com/luniehq/lunie.git - branch = develop + branch = master diff --git a/config.js b/config.js index 4cef6c630f..b625ef3c37 100644 --- a/config.js +++ b/config.js @@ -5,14 +5,9 @@ const stargate = (dev ? `https://localhost:9071` : `https://stargate.lunie.io`) export default { - name: `Lunie`, development: dev, - google_analytics_uid: process.env.GOOGLE_ANALYTICS_UID || '', - sentry_dsn: process.env.SENTRY_DSN || '', - default_gas_price: dev ? 1e-9 : 2.5e-8, // recommended from Cosmos Docs - version: process.env.RELEASE, + google_analytics_uid: process.env.GOOGLE_ANALYTICS_UID || '', // needs to be configured in webpack.config.js + sentry_dsn: process.env.SENTRY_DSN || '', // needs to be configured in webpack.config.js stargate, - - // Ledger - CosmosAppTestModeAllowed: false + lunieLink: dev ? `http://localhost:9080` : `https://app.lunie.io` } diff --git a/lunie b/lunie index 05d712cb38..7bd971d077 160000 --- a/lunie +++ b/lunie @@ -1 +1 @@ -Subproject commit 05d712cb38ffef28bbd177735c4a9167a8e94c5a +Subproject commit 7bd971d07791a87801040d58f9db1b13756881d9 diff --git a/package.json b/package.json index 34193fd0a9..d39a9f94d2 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,13 @@ "build": "cross-env NODE_ENV=production webpack --hide-modules && node ./scripts/remove-localhost.js", "build:dev": "cross-env NODE_ENV=development webpack --hide-modules", "build-zip": "node scripts/build-zip.js", - "initiate-submodule": "git submodule init && git submodule update && cd lunie", + "initiate-submodule": "git submodule init && git submodule update && cd lunie && git checkout origin/master", "watch": "npm run build -- --watch", "watch:dev": "cross-env HMR=true npm run build:dev -- --watch", "test:unit": "jest --coverage", "test": "npm run lint && npm run test:unit", - "test:e2e:build": "npm run build:dev && node ./scripts/add-pem-key.js && cd ./lunie && yarn install && npm run test:e2e:build", + "test:e2e:build": "npm run build:dev && node ./scripts/add-pem-key.js", + "test:e2e:build:lunie": "cd ./lunie && yarn install && npm run test:e2e:build", "test:e2e:start-lunie": "cd ./lunie && npm run serve:dist", "test:e2e": "nightwatch --config ./test/e2e/nightwatch.conf.js", "test:coverage": "live-server test/unit/coverage/lcov-report", @@ -101,7 +102,7 @@ "eslint-plugin-vue": "^5.2.2", "file-loader": "^1.1.11", "husky": "^2.4.0", - "jest": "^24.8.0", + "jest": "^24.9.0", "lint-prepush": "^0.4.1", "live-server": "^1.2.1", "mini-css-extract-plugin": "^0.4.4", @@ -120,5 +121,8 @@ "webpack": "^4.20.2", "webpack-cli": "^3.1.2", "webpack-extension-reloader": "^1.1.0" + }, + "resolutions": { + "handlebars": ">=4.5.2" } -} +} \ No newline at end of file diff --git a/pending/fabo_e2e b/pending/fabo_e2e new file mode 100644 index 0000000000..5c695c4393 --- /dev/null +++ b/pending/fabo_e2e @@ -0,0 +1 @@ +[Fixed] [#110](https://github.com/cosmos/lunie/pull/110) Fix e2e tests by using the lunie-backend docker-compose to run the stack @faboweb \ No newline at end of file diff --git a/src/background.js b/src/background.js index 51eb013f09..bcbec3762a 100644 --- a/src/background.js +++ b/src/background.js @@ -10,6 +10,7 @@ const extensionHost = location.origin const whitelisted = ['https://app.lunie.io', extensionHost] if (process.env.NODE_ENV === 'development') { whitelisted.push('https://localhost') + whitelisted.push('http://localhost') } const signRequestQueue = new SignRequestQueue() diff --git a/src/components/SessionAccounts.vue b/src/components/SessionAccounts.vue index 5ad1a8f4d2..8ff2ba3772 100644 --- a/src/components/SessionAccounts.vue +++ b/src/components/SessionAccounts.vue @@ -27,6 +27,7 @@