update int tests

This commit is contained in:
Roy Crihfield 2023-09-11 23:24:09 +08:00
parent c5be1f37c0
commit 86275727a8
6 changed files with 34 additions and 17 deletions

View File

@ -15,6 +15,11 @@ jobs:
- name: "Run DB container"
run: |
docker compose -f test/compose-db.yml up --wait --quiet-pull
- name: "Set Gitea credentials"
env:
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
run: |
git config --global url."https://$TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"
- name: "Run tests"
run: |
go test -v ./pkg/...
@ -32,10 +37,18 @@ jobs:
uses: actions/checkout@v3
with:
repository: cerc-io/stack-orchestrator
ref: v1.1.0-ff616db-202305310811 # first tag with merged changes for this stack
ref: v1.1.0-97dc455-202308171924 # first tag with merged changes for this stack
path: ./stack-orchestrator
- run: pip install ./stack-orchestrator
- name: "Set Gitea credentials"
env:
TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
run: |
git config --global url."https://$TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"
- name: "Run testnet stack"
env:
CERC_GO_AUTH_TOKEN: ${{ secrets.CICD_REPO_TOKEN }}
run: ./scripts/integration-setup.sh
- name: "Run contract deployer"
run: |
@ -54,4 +67,4 @@ jobs:
wait $!
- name: "Run tests"
run: |
go test -v ./integration/...
go test ./integration/... -v -timeout=20m

2
go.mod
View File

@ -287,7 +287,7 @@ replace (
github.com/cerc-io/eth-ipfs-state-validator/v5 => git.vdb.to/cerc-io/eth-ipfs-state-validator/v5 v5.0.0-20230910103736-6fcae158de32
github.com/cerc-io/eth-iterator-utils => git.vdb.to/cerc-io/eth-iterator-utils v0.0.0-20230910102631-c8330d8c7fb3
github.com/cerc-io/eth-testing => git.vdb.to/cerc-io/eth-testing v0.1.2-0.20230909172706-0d908a1e61f6
github.com/cerc-io/ipld-eth-server/v5 => git.vdb.to/cerc-io/ipld-eth-server 49fbc43b1518c552debe58f4739a6ba22fb16dd7
github.com/cerc-io/ipld-eth-server/v5 => git.vdb.to/cerc-io/ipld-eth-server/v5 v5.0.0-20230911133532-49fbc43b1518
github.com/cerc-io/ipld-eth-statedb => git.vdb.to/cerc-io/ipld-eth-statedb v0.0.5-alpha.0.20230910103157-6cd44545ba8a
github.com/cerc-io/plugeth-statediff => git.vdb.to/cerc-io/plugeth-statediff v0.1.1-0.20230910102119-e43cbb30f919
github.com/ethereum/go-ethereum => git.vdb.to/cerc-io/plugeth v0.0.0-20230808125822-691dc334fab1

2
go.sum
View File

@ -50,6 +50,8 @@ git.vdb.to/cerc-io/eth-ipfs-state-validator/v5 v5.0.0-20230910103736-6fcae158de3
git.vdb.to/cerc-io/eth-iterator-utils v0.0.0-20230910102631-c8330d8c7fb3 h1:EW5Zw4vKRUJb/N095DuGSzNPGsv889muFW4RZj03HOw=
git.vdb.to/cerc-io/eth-iterator-utils v0.0.0-20230910102631-c8330d8c7fb3/go.mod h1:LLNVVr1r5kirXXY6bCjWAT1mrqJ3TV51J8pdyR07Auk=
git.vdb.to/cerc-io/eth-testing v0.1.2-0.20230909172706-0d908a1e61f6 h1:kAvdKNfJmzIHk8/cEGuXnKCU4Xfy42nr2a2zg3IVthE=
git.vdb.to/cerc-io/ipld-eth-server/v5 v5.0.0-20230911133532-49fbc43b1518 h1:E1DxCwQYihs7MxZHYYQtkN9RxZ/p6f8hVaO1KGYRDik=
git.vdb.to/cerc-io/ipld-eth-server/v5 v5.0.0-20230911133532-49fbc43b1518/go.mod h1:NShKIHmnO3MgJ3/oQAv3vUpdbpIRYQsvXhXaqYRmGYc=
git.vdb.to/cerc-io/ipld-eth-statedb v0.0.5-alpha.0.20230910103157-6cd44545ba8a h1:u/VBGhKoqDui2NFJ/8uATr5iDqC7JLSNO3SYUiT3jTo=
git.vdb.to/cerc-io/ipld-eth-statedb v0.0.5-alpha.0.20230910103157-6cd44545ba8a/go.mod h1:uwWvDtI9nUbXtyrUPqbseizF/9ZoLzhbnbecOHMyHow=
git.vdb.to/cerc-io/plugeth v0.0.0-20230808125822-691dc334fab1 h1:KLjxHwp9Zp7xhECccmJS00RiL+VwTuUGLU7qeIctg8g=

View File

@ -16,7 +16,7 @@ import (
)
const (
timeout = 10 * time.Minute
timeout = 20 * time.Minute
pollInterval = time.Second
progressBufferSize = 200
)
@ -56,7 +56,7 @@ func setup(t *testing.T, progressChan chan uint64) {
cfg.FromBlock = lastValidated
}
// default trail is unnecessarily long
cfg.Trail = 16
cfg.Trail = 8
service, err := validator.NewService(cfg, progressChan)
if err != nil {
@ -103,7 +103,7 @@ func TestValidateContracts(t *testing.T) {
g := gomega.NewWithT(t)
var blocks []uint64
for i := 0; i < 5; i++ {
for i := 0; i < 3; i++ {
res, err := integration.PutTestValue(contract.Address, i)
if err != nil {
t.Fatal(err)

View File

@ -1,6 +1,7 @@
#!/bin/bash
# Build and deploy a cluster with only what we need from the stack
set -ex
set -e
CONFIG_DIR=$(readlink -f "${CONFIG_DIR:-$(mktemp -d)}")
@ -9,20 +10,21 @@ export CERC_REPO_BASE_DIR="${CERC_REPO_BASE_DIR:-..}"
# v5 migrations only go up to version 18
echo CERC_STATEDIFF_DB_GOOSE_MIN_VER=18 >> $CONFIG_DIR/stack.env
laconic_so="${LACONIC_SO:-laconic-so} --stack fixturenet-eth-loaded --quiet"
laconic_so="${LACONIC_SO:-laconic-so} --stack fixturenet-plugeth-tx --quiet"
set -x
# Build and deploy a cluster with only what we need from the stack
$laconic_so setup-repositories \
--exclude github.com/cerc-io/ipld-eth-server,github.com/cerc-io/tx-spammer \
--branches-file ./test/stack-refs.txt
if [[ -z $SKIP_BUILD ]]; then
$laconic_so setup-repositories \
--exclude github.com/cerc-io/ipld-eth-server,github.com/cerc-io/tx-spammer \
--branches-file ./test/stack-refs.txt
$laconic_so build-containers \
--exclude cerc/ipld-eth-server,cerc/keycloak,cerc/tx-spammer
$laconic_so build-containers \
--exclude cerc/ipld-eth-server,cerc/keycloak,cerc/tx-spammer
fi
$laconic_so deploy \
--include fixturenet-eth,ipld-eth-db \
--include fixturenet-plugeth,ipld-eth-db \
--env-file $CONFIG_DIR/stack.env \
--cluster test up
@ -47,6 +49,6 @@ export PGPASSWORD=password
query_blocks_exist='SELECT exists(SELECT block_number FROM ipld.blocks LIMIT 1);'
echo "Waiting until we have some data written..."
until [[ "$(psql -qtA cerc_testing -h localhost -U vdbm -p 8077 -c "$query_blocks_exist")" = 't' ]]; do
until [[ "$(psql -qtA cerc_testing -h localhost -U vdbm -p 8077 -c "$query_blocks_exist")" -eq 't' ]]; do
sleep 2
done

View File

@ -3,7 +3,7 @@
services:
contract-deployer:
restart: on-failure
image: cerc/ipld-eth-db-validator/contract-deployer
image: cerc/ipld-eth-db-validator/contract-deployer:local
build: ./contract
networks:
- test_default