From ee48b656a1f4904497c11c7c8016db8384a23f48 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Sun, 7 Jul 2024 14:34:34 +0800 Subject: [PATCH] fix test workflow, update fixtures --- .gitea/workflows/tests.yml | 32 +++++++++++++++++--------------- test/ci-chain.json | 21 --------------------- test/ci-config.toml | 7 +------ test/compose.yml | 2 +- 4 files changed, 19 insertions(+), 43 deletions(-) delete mode 100644 test/ci-chain.json diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 3cf4ff9..6cd9f65 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -9,6 +9,9 @@ on: - ci-test workflow_call: +env: + ETH_TESTING_REF: v0.5.2 + jobs: integration-tests: name: Run integration tests @@ -29,16 +32,15 @@ jobs: with: repository: cerc-io/eth-testing path: ./fixtures - ref: v0.4.0 + ref: ${{ env.ETH_TESTING_REF }} # Run a sanity test against the fixture data # Complete integration tests are TODO - name: Run basic integration test env: - DATABASE_TYPE: postgres - ETHDB_PATH: ./fixtures/chaindata/_data/small2 - ETHDB_ANCIENT: ./fixtures/chaindata/_data/small2/ancient + ETHDB_PATH: ./fixtures/chains/data/premerge2/geth/chaindata + ETH_CHAIN_CONFIG: ./fixtures/chains/data/premerge2/genesis.config.json + ETH_GENESIS_BLOCK: 0x8a3c7cddacbd1ab4ec1b03805fa2a287f3a75e43d87f4f987fcc399f5c042614 LOG_FILE: ./server-log - ETH_GENESIS_BLOCK: "0x8a3c7cddacbd1ab4ec1b03805fa2a287f3a75e43d87f4f987fcc399f5c042614" timeout-minutes: 20 run: | ./eth-statediff-service --config ./test/ci-config.toml serve & @@ -72,12 +74,6 @@ jobs: with: go-version-file: ./eth-statediff-service/go.mod check-latest: true - - name: Install test fixtures - uses: actions/checkout@v3 - with: - repository: cerc-io/eth-testing - path: ./fixtures - ref: v0.4.0 - name: Build current version working-directory: ./eth-statediff-service run: go build -o ../service-current . @@ -91,22 +87,28 @@ jobs: working-directory: ./eth-statediff-service-canonical run: go build -o ../service-canonical . + - name: Install test fixtures + uses: actions/checkout@v3 + with: + repository: cerc-io/eth-testing + path: ./fixtures + ref: ${{ env.ETH_TESTING_REF }} - name: Run DB container working-directory: ./eth-statediff-service run: docker compose -f test/compose.yml up --wait - name: Compare statediff output timeout-minutes: 10 env: - ETHDB_PATH: ./fixtures/chaindata/_data/small2 - ETHDB_ANCIENT: ./fixtures/chaindata/_data/small2/ancient + ETHDB_PATH: ./fixtures/chains/data/premerge2/geth/chaindata + ETHDB_ANCIENT: ./fixtures/chains/data/premerge2/geth/chaindata/ancient + ETH_CHAIN_CONFIG: ./fixtures/chains/data/premerge2/genesis.config.json ETH_GENESIS_BLOCK: "0x8a3c7cddacbd1ab4ec1b03805fa2a287f3a75e43d87f4f987fcc399f5c042614" - ETH_CHAIN_CONFIG: ./eth-statediff-service/test/ci-chain.json run: | until ready_query='select max(version_id) from goose_db_version;' version=$(docker exec -e PGPASSWORD=password test-ipld-eth-db-1 \ psql -tA cerc_testing -U vdbm -c "$ready_query") - [[ "$version" -ge 18 ]] + [[ "$version" -ge 21 ]] do sleep 1; done ./eth-statediff-service/scripts/compare-statediffs.sh \ diff --git a/test/ci-chain.json b/test/ci-chain.json deleted file mode 100644 index 44d2cd2..0000000 --- a/test/ci-chain.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "chainId": 1212, - "homesteadBlock": 0, - "eip150Block": 0, - "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "berlinBlock": 0, - "londonBlock": 0, - "mergeForkBlock": 0, - "terminalTotalDifficulty": 0, - "mergeNetsplitBlock": 0, - "clique": { - "period": 5, - "epoch": 30000 - } -} diff --git a/test/ci-config.toml b/test/ci-config.toml index 37190d5..384af20 100644 --- a/test/ci-config.toml +++ b/test/ci-config.toml @@ -1,8 +1,4 @@ -# Config file for service in compose.yml - -# [ethdb] -# mode = "local" -# url = "http://127.0.0.1:8082/" +# Config file for github workflow [server] ipcPath = ".ipc" @@ -30,7 +26,6 @@ trie = 1024 [ethereum] - chainConfig = "test/ci-chain.json" nodeID = "test-node" clientName = "test-eth-statediff-service" networkID = "test-network" diff --git a/test/compose.yml b/test/compose.yml index 1715384..ab15bb0 100644 --- a/test/compose.yml +++ b/test/compose.yml @@ -3,7 +3,7 @@ services: restart: on-failure depends_on: - ipld-eth-db - image: git.vdb.to/cerc-io/ipld-eth-db/ipld-eth-db:v5.0.5-alpha + image: git.vdb.to/cerc-io/ipld-eth-db/ipld-eth-db:v5.3.0-alpha environment: DATABASE_USER: "vdbm" DATABASE_NAME: "cerc_testing"