-
Notifications
You must be signed in to change notification settings - Fork 16
106 lines (84 loc) · 5.03 KB
/
test_e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This is a basic workflow to help you get started with Actions
name: Integration_test_local_full_node
on:
pull_request:
push:
branches:
- master
jobs:
test-e2e:
name: End-to-end Test
runs-on: ubuntu-latest
steps:
- name: Set up Golang
uses: actions/setup-go@v2
with:
go-version: 1.15.5
- name: Checkout chain-main repository
uses: actions/checkout@v2
with:
repository: crypto-com/chain-main
path: chain-main
ref: v1.2.1
submodules: recursive
- name: Build and start chain-maind
run: |
sudo apt-get install jq
cd chain-main
rm -rf $HOME/.chain-maind
NETWORK=testnet make install
NETWORK=testnet make build
./build/chain-maind unsafe-reset-all
./build/chain-maind init testnode --chain-id testnet -o
./build/chain-maind keys add validator --keyring-backend test --output json >> ./validator.json
./build/chain-maind keys add ecosystem --keyring-backend test --output json >> ./ecosystem.json
./build/chain-maind keys add launch --keyring-backend test --output json >> ./launch.json
./build/chain-maind keys add community --keyring-backend test --output json >> ./community.json
./build/chain-maind keys add reserve --keyring-backend test --output json >> ./reserve.json
./build/chain-maind add-genesis-account $(./build/chain-maind keys show validator -a --keyring-backend test) 200tcro
./build/chain-maind add-genesis-account $(./build/chain-maind keys show ecosystem -a --keyring-backend test) 200tcro
./build/chain-maind add-genesis-account $(./build/chain-maind keys show launch -a --keyring-backend test) 200tcro
./build/chain-maind add-genesis-account $(./build/chain-maind keys show community -a --keyring-backend test) 200tcro
./build/chain-maind add-genesis-account $(./build/chain-maind keys show reserve -a --keyring-backend test) 200tcro
# Issue: gentx denomination is ignored https://github.com/cosmos/cosmos-sdk/issues/8251
./build/chain-maind gentx validator 100tcro --amount 100tcro --keyring-backend test --chain-id testnet
./build/chain-maind collect-gentxs
./build/chain-maind validate-genesis
./build/chain-maind start --trace &
- name: Transfer funds to Test accounts
run: |
## Sleep 5 Seconds
sleep 5
curl --location --request GET 'localhost:26657/status' | jq '.'
cd chain-main
./build/chain-maind keys show validator --bech val --keyring-backend test --output json | jq '.'>> ./validatorDetails.json
## TRANSFER 100CRO FROM "ecosystem" to "tcro1n0jfe772qx5svnme9y2gl75u85luxfjnhkacy0"
./build/chain-maind tx bank send $(./build/chain-maind keys show ecosystem -a --keyring-backend test) tcro1n0jfe772qx5svnme9y2gl75u85luxfjnhkacy0 100tcro --keyring-backend test --chain-id testnet -y | jq '.'
## TRANSFER 100CRO FROM "ecosystem" to "tcro17c6rn92lnw0d8ct37mlycdaeau4f9hm569ef9s"
./build/chain-maind tx bank send $(./build/chain-maind keys show ecosystem -a --keyring-backend test) tcro17c6rn92lnw0d8ct37mlycdaeau4f9hm569ef9s 100tcro --keyring-backend test --chain-id testnet -y | jq '.'
## TRANSFER 10CRO FROM "reserve" to "tcro1c5nd9l5ylh8udw5lsfs0hlvzxwrlymxqlnl266"
./build/chain-maind tx bank send $(./build/chain-maind keys show reserve -a --keyring-backend test) tcro1c5nd9l5ylh8udw5lsfs0hlvzxwrlymxqlnl266 100tcro --keyring-backend test --chain-id testnet -y | jq '.'
- name: Checkout this project
uses: actions/checkout@v2
with:
path: jslib
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- uses: actions/cache@v2
id: cache-deps
with:
path: node_modules
key: ${{ runner.os }}-node${{ matrix.code }}-${{ hashFiles('**/package-lock.json') }}
- name: Run e2e test suite
run: |
cd jslib
npm install --no-progress --silent --quiet
VALIDATOR_OPERATOR_ADDRESS=$(../chain-main/build/chain-maind keys show validator -a --bech val --keyring-backend test) COMMUNITY_ACCOUNT_MNEMONIC=$(cat ../chain-main/community.json | jq '.mnemonic') RESERVE_ACCOUNT_MNEMONIC=$(cat ../chain-main/reserve.json | jq '.mnemonic') ECOSYSTEM_ACCOUNT_MNEMONIC=$(cat ../chain-main/ecosystem.json | jq '.mnemonic')
echo "VALIDATOR_OPERATOR_ADDRESS: $VALIDATOR_OPERATOR_ADDRESS"
echo "COMMUNITY_ACCOUNT_MNEMONIC: $COMMUNITY_ACCOUNT_MNEMONIC"
echo "RESERVE_ACCOUNT_MNEMONIC: $RESERVE_ACCOUNT_MNEMONIC"
echo "ECOSYSTEM_ACCOUNT_MNEMONIC: $ECOSYSTEM_ACCOUNT_MNEMONIC"
# COMMUNITY_ACCOUNT_MNEMONIC=$COMMUNITY_ACCOUNT_MNEMONIC RESERVE_ACCOUNT_MNEMONIC=$RESERVE_ACCOUNT_MNEMONIC ECOSYSTEM_ACCOUNT_MNEMONIC=$ECOSYSTEM_ACCOUNT_MNEMONIC
VALIDATOR_OPERATOR_ADDRESS=$VALIDATOR_OPERATOR_ADDRESS npm run test:e2e