Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2c7b406
Add param for test old client.
laodouya Feb 25, 2019
bb59b5f
Add start_bp_miner for makefile, Add test old clinet task.
laodouya Feb 25, 2019
572160f
Fix test old client case missing param set bug.
laodouya Feb 25, 2019
a5e6baa
Try using build docker with docker command.
laodouya Feb 26, 2019
5061e5c
Revert compatibility test docker build.
laodouya Feb 27, 2019
b767b94
Let testnet_client only run testnet.
laodouya Feb 27, 2019
459bd53
Add test old clinet to current bp miner test.
laodouya Feb 27, 2019
b0972cc
Make bp miner bin before compatibility test.
laodouya Feb 27, 2019
5435557
Make compatibility test bp and miner running background
laodouya Feb 27, 2019
b5232b8
Fix bp miner not running background.
laodouya Feb 27, 2019
223975c
Fix compatibility test, wait for miner start.
laodouya Feb 27, 2019
24a2a9e
Increase integration miner client init stable coin count.
laodouya Feb 28, 2019
cdb9222
Increase compatibility test wait bp miner time.
laodouya Feb 28, 2019
5a00d66
Disable other ci test.
laodouya Feb 28, 2019
8349f4c
Fail compatibility test if dsn not created.
laodouya Feb 28, 2019
70d1914
Fix compatibility test miner config.
laodouya Feb 28, 2019
2978a94
Revert "Disable other ci test."
laodouya Feb 28, 2019
bf1eafd
Add ci build stage, reuse build result in test stage.
laodouya Feb 28, 2019
fbdbda4
Add old bp, old miner case for compatibility test.
laodouya Feb 28, 2019
9197878
Rename gitlab ci task name.
laodouya Feb 28, 2019
1112e67
Fix compatibility miner bin name wrong.
laodouya Feb 28, 2019
61085a6
Seperate logs for different compatibility test case.
laodouya Feb 28, 2019
2d080b5
Update prev bin version to v0.4.0
laodouya Feb 28, 2019
e2a5551
Use a independent cache folder for each ci jobs.
laodouya Feb 28, 2019
2c757ac
Redirect compatibility test bp, miner stdout to files.
laodouya Feb 28, 2019
0607ef2
Create job cache dir if not exist for gitlabci.
laodouya Feb 28, 2019
5c299e2
Use CI_PIPELINE_IID instead of CI_JOB_ID for transfer cache dir.
laodouya Feb 28, 2019
10a16c7
Seperate cache bin dir and log dir.
laodouya Feb 28, 2019
7a95e63
Remove all cache folder while ci success.
laodouya Feb 28, 2019
7aef69d
Combine ci cleanup process.
laodouya Feb 28, 2019
3451b40
Use independent config file for compatibility test.
laodouya Feb 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 60 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
image: covenantsql/build

stages:
- build
- test
- cleanup

variables:
REVIEWDOG_VERSION: 0.9.11
REVIEWDOG_GITLAB_API_TOKEN: $REVIEWDOG_TOKEN
CODECOV_TOKEN: $CODECOV_TOKEN
UNITTESTTAGS: linux sqlite_omit_load_extension
CACHE_DIR: /CovenantSQL_bins
PIPELINE_CACHE: $CACHE_DIR/$CI_PIPELINE_IID
BIN_CACHE: $CACHE_DIR/$CI_PIPELINE_IID/bin
PREV_VERSION: v0.4.0
# gitlabci bins: 192.168.2.100:/srv/gitlab-runner/config/CovenantSQL_bins

before_script:
# Setup dependency management tool
Expand All @@ -23,12 +33,23 @@ before_script:
- ulimit -n 8192
# - curl -fSL https://github.com/haya14busa/reviewdog/releases/download/$REVIEWDOG_VERSION/reviewdog_linux_amd64 -o ~/bin/reviewdog && chmod +x ~/bin/reviewdog

test-my-project:
build:
stage: build
script:
- set -x
- make clean
- make use_all_cores
- mkdir -p ${BIN_CACHE}
- cp bin/* ${BIN_CACHE}/

unit-test:
stage: test
script:
- make clean
- cp ${BIN_CACHE}/* bin/
- ./alltest.sh

compatibility-testnet:
testnet-compatibility:
stage: test
script:
- set -o errexit
Expand All @@ -37,7 +58,43 @@ compatibility-testnet:
- branch=$(git branch -rv |grep $commit | awk '{print $1}')
- if [[ $branch =~ "/beta_" ]]; then exit 0; fi
- make clean
- make -j8 client
- cp ${BIN_CACHE}/* bin/
- go test -tags "$UNITTESTTAGS" -bench=^BenchmarkTestnetMiner2$ -benchtime=5s -run ^$ ./cmd/cql-minerd/
- set -x
- ./test/testnet_client/run.sh

old-client-compatibility:
stage: test
script:
- set -o errexit
- set -o pipefail
- set -x
- make clean
- cp ${BIN_CACHE}/* bin/
- ./test/compatibility/specific_old.sh client

old-bp-compatibility:
stage: test
script:
- set -o errexit
- set -o pipefail
- set -x
- make clean
- cp ${BIN_CACHE}/* bin/
- ./test/compatibility/specific_old.sh bp

old-miner-compatibility:
stage: test
script:
- set -o errexit
- set -o pipefail
- set -x
- make clean
- cp ${BIN_CACHE}/* bin/
- ./test/compatibility/specific_old.sh miner

cleanup_cache:
stage: cleanup
script:
- rm -r ${PIPELINE_CACHE}
when: on_success
3 changes: 0 additions & 3 deletions alltest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ set -o pipefail
set -o nounset

main() {
make clean
make -j5 bp miner bin/cql.test

go test -tags "$UNITTESTTAGS" -race -failfast -parallel 16 -cpu 16 -coverprofile main.cover.out $(go list ./... | grep -v CovenantSQL/api)
go test -tags "$UNITTESTTAGS" -race -failfast -parallel 16 -cpu 16 -coverpkg ./api/...,./rpc/jsonrpc -coverprofile api.cover.out ./api/...

Expand Down
122 changes: 122 additions & 0 deletions test/compatibility/node_0/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
IsTestMode: true
WorkingRoot: "./"
PubKeyStoreFile: "public.keystore"
PrivateKeyFile: "private.key"
DHTFileName: "dht.db"
ListenAddr: "127.0.0.1:3122"
ThisNodeID: "00000bef611d346c0cbe1beaa76e7f0ed705a194fdf9ac3a248ec70e9c198bf9"
QPS: 1000
BillingBlockCount: 2
ChainBusPeriod: 1s
BPPeriod: 3s
BPTick: 1s
SQLChainPeriod: 3s
SQLChainTick: 1s
SQLChainTTL: 10
MinProviderDeposit: 1000000
ValidDNSKeys:
koPbw9wmYZ7ggcjnQ6ayHyhHaDNMYELKTqT+qRGrZpWSccr/lBcrm10Z1PuQHB3Azhii+sb0PYFkH1ruxLhe5g==: cloudflare.com
mdsswUyr3DPW132mOi8V9xESWE8jTo0dxCjjnopKl+GqJxpVXckHAeF+KkxLbxILfDLUT0rAK9iUzy1L53eKGQ==: cloudflare.com
oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA==: cloudflare.com
MinNodeIDDifficulty: 2
DNSSeed:
EnforcedDNSSEC: false
DNSServers:
- 1.1.1.1
- 202.46.34.74
- 202.46.34.75
- 202.46.34.76

BlockProducer:
PublicKey: "02c76216704d797c64c58bc11519fb68582e8e63de7e5b3b2dbbbe8733efe5fd24"
NodeID: 00000bef611d346c0cbe1beaa76e7f0ed705a194fdf9ac3a248ec70e9c198bf9
Nonce:
a: 313283
b: 0
c: 0
d: 0
ChainFileName: "chain.db"
BPGenesisInfo:
Version: 1
BlockHash: f745ca6427237aac858dd3c7f2df8e6f3c18d0f1c164e07a1c6b8eebeba6b154
Producer: 0000000000000000000000000000000000000000000000000000000000000001
MerkleRoot: 0000000000000000000000000000000000000000000000000000000000000001
ParentHash: 0000000000000000000000000000000000000000000000000000000000000001
Timestamp: 2018-08-13T21:59:59.12Z
BaseAccounts:
- Address: ba0ba731c7a76ccef2c1170f42038f7e228dfb474ef0190dfe35d9a37911ed37
StableCoinBalance: 10000000000000000000
CovenantCoinBalance: 10000000000000000000
- Address: 1a7b0959bbd0d0ec529278a61c0056c277bffe75b2646e1699b46b10a90210be
StableCoinBalance: 10000000000000000000
CovenantCoinBalance: 10000000000000000000
- Address: 9235bc4130a2ed4e6c35ea189dab35198ebb105640bedb97dd5269cc80863b16
StableCoinBalance: 10000000000000000000
CovenantCoinBalance: 10000000000000000000
- Address: 9e1618775cceeb19f110e04fbc6c5bca6c8e4e9b116e193a42fe69bf602e7bcd
StableCoinBalance: 10000000000000000000
CovenantCoinBalance: 10000000000000000000
KnownNodes:
- ID: 00000bef611d346c0cbe1beaa76e7f0ed705a194fdf9ac3a248ec70e9c198bf9
Nonce:
a: 313283
b: 0
c: 0
d: 0
Addr: 127.0.0.1:3122
PublicKey: "02c76216704d797c64c58bc11519fb68582e8e63de7e5b3b2dbbbe8733efe5fd24"
Role: Leader
- ID: 00000381d46fd6cf7742d7fb94e2422033af989c0e348b5781b3219599a3af35
Nonce:
a: 478373
b: 0
c: 0
d: 2305843009893772025
Addr: 127.0.0.1:3121
PublicKey: "02c76216704d797c64c58bc11519fb68582e8e63de7e5b3b2dbbbe8733efe5fd24"
Role: Follower
- ID: 000000172580063ded88e010556b0aca2851265be8845b1ef397e8fce6ab5582
Nonce:
a: 259939
b: 0
c: 0
d: 2305843012544226372
Addr: 127.0.0.1:3120
PublicKey: "02c76216704d797c64c58bc11519fb68582e8e63de7e5b3b2dbbbe8733efe5fd24"
Role: Follower
- ID: 00000f3b43288fe99831eb533ab77ec455d13e11fc38ec35a42d4edd17aa320d
Nonce:
a: 22403
b: 0
c: 0
d: 0
Addr: ""
PublicKey: 02ec784ca599f21ef93fe7abdc68d78817ab6c9b31f2324d15ea174d9da498b4c4
Role: Client
- ID: 000005aa62048f85da4ae9698ed59c14ec0d48a88a07c15a32265634e7e64ade
Nonce:
a: 567323
b: 0
c: 0
d: 3104982049
Addr: 127.0.0.1:2144
PublicKey: 0367aa51809a7c1dc0f82c02452fec9557b3e1d10ce7c919d8e73d90048df86d20
Role: Miner
- ID: 000005f4f22c06f76c43c4f48d5a7ec1309cc94030cbf9ebae814172884ac8b5
Nonce:
a: 240524
b: 0
c: 0
d: 2305843010430351476
Addr: 127.0.0.1:2145
PublicKey: 02914bca0806f040dd842207c44474ab41ecd29deee7f2d355789c5c78d448ca16
Role: Miner
- ID: 000003f49592f83d0473bddb70d543f1096b4ffed5e5f942a3117e256b7052b8
Nonce:
a: 606016
b: 0
c: 0
d: 13835058056920509601
Addr: 127.0.0.1:2146
PublicKey: 03ae859eac5b72ee428c7a85f10b2ce748d9de5e480aefbb70f6597dfa8b2175e5
Role: Miner
2 changes: 2 additions & 0 deletions test/compatibility/node_0/private.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
WAð�8��#|�T��Z�ԓ�`�mF�}�~�e��ʆ?�~�����*E��%���v�����p�o*a߂�ç_Bľ@8
��M�C2�
122 changes: 122 additions & 0 deletions test/compatibility/node_1/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
IsTestMode: true
WorkingRoot: "./"
PubKeyStoreFile: "public.keystore"
PrivateKeyFile: "private.key"
DHTFileName: "dht.db"
ListenAddr: "127.0.0.1:3121"
ThisNodeID: "00000381d46fd6cf7742d7fb94e2422033af989c0e348b5781b3219599a3af35"
QPS: 1000
BillingBlockCount: 2
ChainBusPeriod: 1s
BPPeriod: 3s
BPTick: 1s
SQLChainPeriod: 3s
SQLChainTick: 1s
SQLChainTTL: 10
MinProviderDeposit: 1000000
ValidDNSKeys:
koPbw9wmYZ7ggcjnQ6ayHyhHaDNMYELKTqT+qRGrZpWSccr/lBcrm10Z1PuQHB3Azhii+sb0PYFkH1ruxLhe5g==: cloudflare.com
mdsswUyr3DPW132mOi8V9xESWE8jTo0dxCjjnopKl+GqJxpVXckHAeF+KkxLbxILfDLUT0rAK9iUzy1L53eKGQ==: cloudflare.com
oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA==: cloudflare.com
MinNodeIDDifficulty: 2
DNSSeed:
EnforcedDNSSEC: false
DNSServers:
- 1.1.1.1
- 202.46.34.74
- 202.46.34.75
- 202.46.34.76

BlockProducer:
PublicKey: "02c76216704d797c64c58bc11519fb68582e8e63de7e5b3b2dbbbe8733efe5fd24"
NodeID: 00000bef611d346c0cbe1beaa76e7f0ed705a194fdf9ac3a248ec70e9c198bf9
Nonce:
a: 313283
b: 0
c: 0
d: 0
ChainFileName: "chain.db"
BPGenesisInfo:
Version: 1
BlockHash: f745ca6427237aac858dd3c7f2df8e6f3c18d0f1c164e07a1c6b8eebeba6b154
Producer: 0000000000000000000000000000000000000000000000000000000000000001
MerkleRoot: 0000000000000000000000000000000000000000000000000000000000000001
ParentHash: 0000000000000000000000000000000000000000000000000000000000000001
Timestamp: 2018-08-13T21:59:59.12Z
BaseAccounts:
- Address: ba0ba731c7a76ccef2c1170f42038f7e228dfb474ef0190dfe35d9a37911ed37
StableCoinBalance: 10000000000000000000
CovenantCoinBalance: 10000000000000000000
- Address: 1a7b0959bbd0d0ec529278a61c0056c277bffe75b2646e1699b46b10a90210be
StableCoinBalance: 10000000000000000000
CovenantCoinBalance: 10000000000000000000
- Address: 9235bc4130a2ed4e6c35ea189dab35198ebb105640bedb97dd5269cc80863b16
StableCoinBalance: 10000000000000000000
CovenantCoinBalance: 10000000000000000000
- Address: 9e1618775cceeb19f110e04fbc6c5bca6c8e4e9b116e193a42fe69bf602e7bcd
StableCoinBalance: 10000000000000000000
CovenantCoinBalance: 10000000000000000000
KnownNodes:
- ID: 00000bef611d346c0cbe1beaa76e7f0ed705a194fdf9ac3a248ec70e9c198bf9
Nonce:
a: 313283
b: 0
c: 0
d: 0
Addr: 127.0.0.1:3122
PublicKey: "02c76216704d797c64c58bc11519fb68582e8e63de7e5b3b2dbbbe8733efe5fd24"
Role: Leader
- ID: 00000381d46fd6cf7742d7fb94e2422033af989c0e348b5781b3219599a3af35
Nonce:
a: 478373
b: 0
c: 0
d: 2305843009893772025
Addr: 127.0.0.1:3121
PublicKey: "02c76216704d797c64c58bc11519fb68582e8e63de7e5b3b2dbbbe8733efe5fd24"
Role: Follower
- ID: 000000172580063ded88e010556b0aca2851265be8845b1ef397e8fce6ab5582
Nonce:
a: 259939
b: 0
c: 0
d: 2305843012544226372
Addr: 127.0.0.1:3120
PublicKey: "02c76216704d797c64c58bc11519fb68582e8e63de7e5b3b2dbbbe8733efe5fd24"
Role: Follower
- ID: 00000f3b43288fe99831eb533ab77ec455d13e11fc38ec35a42d4edd17aa320d
Nonce:
a: 22403
b: 0
c: 0
d: 0
Addr: ""
PublicKey: 02ec784ca599f21ef93fe7abdc68d78817ab6c9b31f2324d15ea174d9da498b4c4
Role: Client
- ID: 000005aa62048f85da4ae9698ed59c14ec0d48a88a07c15a32265634e7e64ade
Nonce:
a: 567323
b: 0
c: 0
d: 3104982049
Addr: 127.0.0.1:2144
PublicKey: 0367aa51809a7c1dc0f82c02452fec9557b3e1d10ce7c919d8e73d90048df86d20
Role: Miner
- ID: 000005f4f22c06f76c43c4f48d5a7ec1309cc94030cbf9ebae814172884ac8b5
Nonce:
a: 240524
b: 0
c: 0
d: 2305843010430351476
Addr: 127.0.0.1:2145
PublicKey: 02914bca0806f040dd842207c44474ab41ecd29deee7f2d355789c5c78d448ca16
Role: Miner
- ID: 000003f49592f83d0473bddb70d543f1096b4ffed5e5f942a3117e256b7052b8
Nonce:
a: 606016
b: 0
c: 0
d: 13835058056920509601
Addr: 127.0.0.1:2146
PublicKey: 03ae859eac5b72ee428c7a85f10b2ce748d9de5e480aefbb70f6597dfa8b2175e5
Role: Miner
2 changes: 2 additions & 0 deletions test/compatibility/node_1/private.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
WAð�8��#|�T��Z�ԓ�`�mF�}�~�e��ʆ?�~�����*E��%���v�����p�o*a߂�ç_Bľ@8
��M�C2�
Loading