2024-05-17 17:22:23 +00:00
|
|
|
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
|
2024-08-04 01:35:57 +00:00
|
|
|
FIXTURENET_ETH_STACKS_REF: roysc/add-ipld-eth-server
|
2024-05-17 17:22:23 +00:00
|
|
|
|
|
|
|
jobs:
|
2024-07-01 14:01:27 +00:00
|
|
|
test-beacon-collector:
|
|
|
|
name: Run Beacon collector tests
|
2024-05-17 17:22:23 +00:00
|
|
|
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
|
2024-05-30 11:12:24 +00:00
|
|
|
token: ${{ secrets.CICD_REPO_TOKEN }}
|
2024-05-17 17:22:23 +00:00
|
|
|
- name: "Install pytest"
|
|
|
|
working-directory: ./system-tests
|
|
|
|
run: pip3 install pytest
|
2024-07-25 13:09:34 +00:00
|
|
|
- name: "Clone fixturenet stack repo"
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: cerc-io/fixturenet-eth-stacks
|
|
|
|
ref: ${{ env.FIXTURENET_ETH_STACKS_REF }}
|
|
|
|
path: ./fixturenet-eth-stacks
|
|
|
|
progress: false
|
2024-05-17 17:22:23 +00:00
|
|
|
|
|
|
|
- name: "Run fixturenet stack"
|
2024-07-25 13:09:34 +00:00
|
|
|
run: ./scripts/run-test-stack.sh ./fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-plugeth
|
2024-05-17 17:22:23 +00:00
|
|
|
- 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
|
2024-08-04 01:44:56 +00:00
|
|
|
pip3 install --no-deps 'eth-account>=0.12.3,<0.13'
|
2024-05-17 17:22:23 +00:00
|
|
|
pip3 install 'pydantic>=2.0.0'
|
|
|
|
python3 -m pytest -vv -k test_blob_tx
|
2024-07-01 14:01:27 +00:00
|
|
|
|
|
|
|
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" ]
|