Ultimate e2e - Native to erc - UI (#168)
* Trying job * dependency * Run the tests * Oracle docker composes * Fixed networks * endpoints * Skip logging * Try node * Moved chromedriver from ui to ui-e2e * Port * Run * Install chrome * minte blocks * Finishing * Revert "Skip logging" 76747eb7efd2ba3c93deedc62caca91a374357eb * inventory * Inventory change. * ui-e2e fix * ui-e2e fix? * native-to-erc group * jobs * Ports * Blocks * yarn * fix * fix * killall * Try ui-e2e * no killall * All jobs. * Try two * separate jobs * all jobs * One job. * Removed the oracle-e2e step in ultimate tests.
This commit is contained in:
parent
272dc142de
commit
414fe9cb65
@ -134,10 +134,35 @@ jobs:
|
|||||||
docker_layer_caching: true
|
docker_layer_caching: true
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
- run: git submodule update --init
|
||||||
- run:
|
- run:
|
||||||
name: Install redis tools
|
name: Install redis tools
|
||||||
command: sudo apt-get install -y redis-tools
|
command: sudo apt-get install -y redis-tools
|
||||||
- run: git submodule update --init
|
- run:
|
||||||
|
name: Install node
|
||||||
|
command: |
|
||||||
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
|
||||||
|
export NVM_DIR="/opt/circleci/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
nvm install v10.15.3
|
||||||
|
nvm alias default v10.15.3
|
||||||
|
|
||||||
|
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
||||||
|
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
|
||||||
|
- run:
|
||||||
|
name: Install Chrome
|
||||||
|
command: |
|
||||||
|
wget -O chrome.deb https://www.slimjet.com/chrome/download-chrome.php?file=files%2F75.0.3770.80%2Fgoogle-chrome-stable_current_amd64.deb
|
||||||
|
sudo dpkg -i chrome.deb
|
||||||
|
- run:
|
||||||
|
name: Install yarn
|
||||||
|
command: |
|
||||||
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||||
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||||
|
sudo apt-get update && sudo apt-get install yarn
|
||||||
|
- run:
|
||||||
|
name: Install npm packages
|
||||||
|
command: nvm use default; yarn install --frozen-lockfile
|
||||||
- run:
|
- run:
|
||||||
name: Prepare the infrastructure
|
name: Prepare the infrastructure
|
||||||
command: e2e-commons/up.sh deploy native-to-erc
|
command: e2e-commons/up.sh deploy native-to-erc
|
||||||
@ -158,8 +183,11 @@ jobs:
|
|||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
- run:
|
- run:
|
||||||
name: Run the oracle-e2e tests
|
name: Run the ui-e2e tests
|
||||||
command: cd e2e-commons && docker-compose run e2e yarn workspace oracle-e2e run native-to-erc
|
command: |
|
||||||
|
nvm use default;
|
||||||
|
node ./e2e-commons/scripts/blocks.js &
|
||||||
|
cd ui-e2e; yarn mocha -g "NATIVE TO ERC" -b ./test.js
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
tokenbridge:
|
tokenbridge:
|
||||||
|
56
deployment/group_vars/native-to-erc.yml
Normal file
56
deployment/group_vars/native-to-erc.yml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
## General settings
|
||||||
|
BRIDGE_MODE: "NATIVE_TO_ERC"
|
||||||
|
HOME_NATIVE_NAME: "POA"
|
||||||
|
ALLOW_HTTP: yes
|
||||||
|
LOG_LEVEL: debug
|
||||||
|
|
||||||
|
## Home contract
|
||||||
|
HOME_RPC_URL: "https://sokol.poa.network"
|
||||||
|
HOME_NAME: "POA Sokol"
|
||||||
|
HOME_WITHOUT_EVENTS: false
|
||||||
|
HOME_BRIDGE_ADDRESS: "0x32198D570fffC7033641F8A9094FFDCaAEF42624"
|
||||||
|
HOME_POLLING_INTERVAL: 5000
|
||||||
|
|
||||||
|
## Foreign contract
|
||||||
|
FOREIGN_RPC_URL: "https://sokol.poa.network"
|
||||||
|
FOREIGN_NAME: "Kovan"
|
||||||
|
FOREIGN_WITHOUT_EVENTS: false
|
||||||
|
FOREIGN_BRIDGE_ADDRESS: "0x2B6871b9B02F73fa24F4864322CdC78604207769"
|
||||||
|
ERC20_TOKEN_ADDRESS: "0xdbeE25CbE97e4A5CC6c499875774dc7067E9426B"
|
||||||
|
FOREIGN_POLLING_INTERVAL: 1000
|
||||||
|
|
||||||
|
## Home Gasprice
|
||||||
|
HOME_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
|
||||||
|
HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||||
|
HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei
|
||||||
|
HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||||
|
HOME_GAS_PRICE_FACTOR: 1
|
||||||
|
|
||||||
|
## Foreign Gasprice
|
||||||
|
FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
|
||||||
|
FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
|
||||||
|
FOREIGN_GAS_PRICE_FALLBACK: 1000000000 # in wei
|
||||||
|
FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||||
|
FOREIGN_GAS_PRICE_FACTOR: 1
|
||||||
|
|
||||||
|
## UI
|
||||||
|
UI_TITLE: "TokenBridge UI app - %c"
|
||||||
|
UI_DESCRIPTION: "The POA cross-chain bridge serves as a method of transferring POA native tokens from the POA Network to the Ethereum network in a quick and cost-efficient manner."
|
||||||
|
UI_PORT: 3000
|
||||||
|
UI_HOME_EXPLORER_TX_TEMPLATE: https://blockscout.com/poa/sokol/tx/%s
|
||||||
|
UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/kovan/tx/%s
|
||||||
|
UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/poa/sokol/address/%s
|
||||||
|
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/kovan/address/%s
|
||||||
|
UI_HOME_GAS_PRICE_FALLBACK: 1000000000
|
||||||
|
UI_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
|
||||||
|
|
||||||
|
## Monitor
|
||||||
|
MONITOR_PORT: 3003
|
||||||
|
MONITOR_HOME_DEPLOYMENT_BLOCK: 0
|
||||||
|
MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 0
|
||||||
|
MONITOR_HOME_GAS_LIMIT: 300000
|
||||||
|
MONITOR_FOREIGN_GAS_LIMIT: 300000
|
||||||
|
MONITOR_HOME_GAS_PRICE_FALLBACK: 1000000000
|
||||||
|
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
|
||||||
|
MONITOR_LEFT_TX_THRESHOLD: 100
|
@ -1,3 +1,5 @@
|
|||||||
---
|
---
|
||||||
- import_playbook: ../../site.yml
|
- import_playbook: ../../site.yml
|
||||||
- import_playbook: ./overwrite-docker-compose.yml
|
# The docker-compose files have to be modified, in order to join the docker containers over network with the parity containers
|
||||||
|
- import_playbook: ./oracle-docker-compose.yml
|
||||||
|
- import_playbook: ./ui-docker-compose.yml
|
||||||
|
@ -4,7 +4,7 @@ driver:
|
|||||||
platforms:
|
platforms:
|
||||||
- name: oracle-native-to-erc-host
|
- name: oracle-native-to-erc-host
|
||||||
groups:
|
groups:
|
||||||
- example
|
- native-to-erc
|
||||||
children:
|
children:
|
||||||
- oracle
|
- oracle
|
||||||
image: ubuntu:16.04
|
image: ubuntu:16.04
|
||||||
@ -12,6 +12,16 @@ platforms:
|
|||||||
network_mode: host
|
network_mode: host
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- name: ui-native-to-erc-host
|
||||||
|
groups:
|
||||||
|
- native-to-erc
|
||||||
|
children:
|
||||||
|
- ui
|
||||||
|
image: ubuntu:16.04
|
||||||
|
privileged: true
|
||||||
|
network_mode: host
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
playbooks:
|
playbooks:
|
||||||
@ -21,15 +31,14 @@ provisioner:
|
|||||||
host_vars:
|
host_vars:
|
||||||
oracle-native-to-erc-host:
|
oracle-native-to-erc-host:
|
||||||
bridge_repo_branch: $CODEBASE_BRANCH
|
bridge_repo_branch: $CODEBASE_BRANCH
|
||||||
VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
|
||||||
VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
|
||||||
HOME_BRIDGE_ADDRESS: "0x32198D570fffC7033641F8A9094FFDCaAEF42624"
|
|
||||||
FOREIGN_BRIDGE_ADDRESS: "0x2B6871b9B02F73fa24F4864322CdC78604207769"
|
|
||||||
ERC20_TOKEN_ADDRESS: "0xdbeE25CbE97e4A5CC6c499875774dc7067E9426B"
|
|
||||||
HOME_RPC_URL: "http://parity1:8545"
|
HOME_RPC_URL: "http://parity1:8545"
|
||||||
FOREIGN_RPC_URL: "http://parity2:8545"
|
FOREIGN_RPC_URL: "http://parity2:8545"
|
||||||
ALLOW_HTTP: yes
|
VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
||||||
LOG_LEVEL: debug
|
VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||||
|
ui-native-to-erc-host:
|
||||||
|
bridge_repo_branch: $CODEBASE_BRANCH
|
||||||
|
HOME_RPC_URL: "http://localhost:8541"
|
||||||
|
FOREIGN_RPC_URL: "http://localhost:8542"
|
||||||
verifier:
|
verifier:
|
||||||
name: testinfra
|
name: testinfra
|
||||||
lint:
|
lint:
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
# The Oracle's docker-compose file has to be modified, in order to join the docker containers over network with the parity containers
|
- name: Overwrite Oracle the docker-compose
|
||||||
- name: Overwrite the docker-compose
|
|
||||||
hosts: oracle
|
hosts: oracle
|
||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
- name: Overwrite UI the docker-compose
|
||||||
|
hosts: ui
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: stop the service
|
||||||
|
shell: service tokenbridge-ui stop
|
||||||
|
|
||||||
|
- name: Slurp docker compose file
|
||||||
|
slurp:
|
||||||
|
src: "/home/poadocker/bridge/ui/docker-compose.yml"
|
||||||
|
register: docker_compose_slurp
|
||||||
|
- name: Parse docker compose file
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
|
||||||
|
|
||||||
|
- name: Add the external network used to connect to Parity nodes
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_parsed |combine({'networks': {'ultimate': {'external': 'true'}}}, recursive=True) }}"
|
||||||
|
|
||||||
|
- name: Add all UI containers to the network
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {item: {'networks': ['ultimate']}}}, recursive=True) }}"
|
||||||
|
with_items: "{{ docker_compose_parsed.services }}"
|
||||||
|
|
||||||
|
- name: Write new docker-compose file
|
||||||
|
copy:
|
||||||
|
content: "{{ docker_compose_parsed | to_yaml }}"
|
||||||
|
dest: "/home/poadocker/bridge/ui/docker-compose.yml"
|
||||||
|
|
||||||
|
- name: start the service
|
||||||
|
shell: service tokenbridge-ui start
|
@ -4,7 +4,9 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"selenium-webdriver": "3.6.0"
|
"selenium-webdriver": "3.6.0",
|
||||||
|
"mocha": "^5.2.0",
|
||||||
|
"chromedriver": "^2.35.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint . --ignore-path ../.eslintignore"
|
"lint": "eslint . --ignore-path ../.eslintignore"
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-proposal-decorators": "^7.4.0",
|
"@babel/plugin-proposal-decorators": "^7.4.0",
|
||||||
"bignumber.js": "^6.0.0",
|
"bignumber.js": "^6.0.0",
|
||||||
"chromedriver": "^2.35.0",
|
|
||||||
"coveralls": "^3.0.0",
|
"coveralls": "^3.0.0",
|
||||||
"customize-cra": "^0.2.12",
|
"customize-cra": "^0.2.12",
|
||||||
"dotenv": "^7.0.0",
|
"dotenv": "^7.0.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user