eth-blob-indexer/.gitea/workflows/test.yml

98 lines
3.0 KiB
YAML
Raw Normal View History

name: Tests
on:
pull_request:
branches: '*'
push:
branches:
- main
- ci-test
env:
SO_VERSION: roysc/fix-eth-stacks
SYSTEM_TESTS_REF: roysc/test-blob-tx
jobs:
test-beacon-collector:
name: Run Beacon collector tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- name: "Build server image"
run: docker build . -t cerc/eth-blob-indexer:local
- name: "Install Python"
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: "Install stack-orchestrator"
uses: actions/checkout@v3
with:
repository: cerc-io/stack-orchestrator
ref: ${{ env.SO_VERSION }}
path: ./stack-orchestrator
- run: pip install ./stack-orchestrator
- name: "Clone system-tests"
uses: actions/checkout@v3
with:
repository: cerc-io/system-tests
ref: ${{ env.SYSTEM_TESTS_REF }}
path: ./system-tests
token: ${{ secrets.CICD_REPO_TOKEN }}
- name: "Install pytest"
working-directory: ./system-tests
run: pip3 install pytest
- name: "Run fixturenet stack"
run: ./scripts/integration-setup.sh
- name: "Run server"
run: docker compose -f test/compose.yml up --wait --quiet-pull
- name: "Run tests"
working-directory: ./system-tests
# Work around dependency conflicts:
# - web3 uses an older eth-account until (unreleased) v7
# - old pydantic is pinned by stack-orchestrator
run: |
pip3 install -r requirements.txt
pip3 install --no-deps 'eth-account>=0.12.3'
pip3 install 'pydantic>=2.0.0'
python3 -m pytest -vv -k test_blob_tx
test-blobscan-scraper:
name: Run Blobscan scraper tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
check-latest: true
- name: "Install redis-cli"
env:
DEBIAN_FRONTEND: noninteractive
run: apt-get update && apt-get install -y redis-tools
- name: "Run Blob DB"
working-directory: ./test
run: docker compose up eth-blob-db --wait --quiet-pull
# Check a mainnet blob
- name: "Run tests"
env:
TEST_BLOCK: 20000000
TEST_VHASH: 0x017ba4bd9c166498865a3d08618e333ee84812941b5c3a356971b4a6ffffa574
# First 10 bytes of blob data
EXPECTED_VALUE: 2100000675789c8cd37b0a
run: |
REDIS_PORT=$(docker port test-eth-blob-db-1 6379 | cut -d: -f2)
go run ./cmd/blobscan-scraper \
--redis-addr localhost:$REDIS_PORT --log-level debug \
--from-block $TEST_BLOCK --to-block $((TEST_BLOCK + 1))
VALUE=$(redis-cli -p $REDIS_PORT GETRANGE blob:$TEST_VHASH 0 9 | od -An -tx1 | tr -d ' \n')
[ "$EXPECTED_VALUE" = "$VALUE" ]