Skip to content

Commit

Permalink
implement historydb test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed Oct 25, 2024
1 parent 810d872 commit b9ad8d4
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/historydb.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "SYB historydb test"

on:
push:
branches-ignore:
- "main"
paths:
- "go_sequencer/database/historydb/**"
workflow_dispatch:

jobs:
core-build:
strategy:
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 10

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: statedb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.5"
check-latest: true
cache-dependency-path: |
./go_sequencer/go.sum
- name: Install dependencies
run: |
cd ./go_sequencer
go mod tidy
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run historydb tests
run: |
cd ./go_sequencer
task test-historydb
env:
PGHOST: "localhost"
PGPORT: "5432"
PGUSER: "postgres"
PGPASSWORD: "postgres"
PGDATABASE: "statedb"

2 changes: 1 addition & 1 deletion go_sequencer/database/historydb/historydb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestBatches(t *testing.T) {
batch.Batch.GasPrice = big.NewInt(0)
batches = append(batches, batch.Batch)
forgeTxsNum := batch.Batch.ForgeL1TxsNum
if forgeTxsNum != nil && (lastL1TxsNum == nil || *lastL1TxsNum < *forgeTxsNum) {
if forgeTxsNum != nil && *lastL1TxsNum < *forgeTxsNum {
*lastL1TxsNum = *forgeTxsNum
lastL1BatchBlockNum = batch.Batch.EthBlockNum
}
Expand Down

0 comments on commit b9ad8d4

Please sign in to comment.