Skip to content

Commit

Permalink
Update workflow to run unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamesh0 committed Jun 15, 2022
1 parent e5253d3 commit 8fed0a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
workflow_call:

env:
stack-orchestrator-ref: ${{ github.event.inputs.stack-orchestrator-ref || 'feature/geth-testing'}}
ipld-eth-db-ref: ${{ github.event.inputs.ipld-ethcl-db-ref || 'feature/startup-script' }}
stack-orchestrator-ref: "382aca8e42bc5e33f301f77cdd2e09cc80602fc3"
ipld-eth-db-ref: "48eb594ea95763bda8e51590f105f7a2657ac6d4"
GOPATH: /tmp/go

jobs:
Expand Down Expand Up @@ -70,21 +70,15 @@ jobs:
- name: Create config file
run: |
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ > $GITHUB_WORKSPACE/config.sh
echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ >> $GITHUB_WORKSPACE/config.sh
echo db_write=true >> $GITHUB_WORKSPACE/config.sh
cat $GITHUB_WORKSPACE/config.sh
- name: Run docker compose
run: |
docker-compose \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-migration.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-timescale-db.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" \
--env-file $GITHUB_WORKSPACE/config.sh \
up -d --build
- name: Give the migration a few seconds
run: sleep 30;

- name: Run unit tests
run: make statedifftest

Expand Down Expand Up @@ -135,9 +129,8 @@ jobs:
- name: Run docker compose
run: |
docker-compose \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-migration.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum4.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-timescale-db.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-db-sharding.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \
--env-file $GITHUB_WORKSPACE/config.sh \
up -d --build
Expand All @@ -160,7 +153,7 @@ jobs:
- name: Make sure we see entries in the header table
shell: bash
run: |
rows=$(docker compose -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" exec access-node psql -U vdbm -d vulcanize_testing_v4 -AXqtc "SELECT COUNT(*) FROM eth.header_cids")
rows=$(docker compose -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" exec ipld-eth-db psql -U vdbm -d vulcanize_testing -AXqtc "SELECT COUNT(*) FROM eth.header_cids")
[[ "$rows" -lt "1" ]] && echo "We could not find any rows in postgres table." && (exit 1)
echo $rows
docker compose -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" exec access-node psql -U vdbm -d vulcanize_testing_v4 -AXqtc "SELECT * FROM eth.header_cids"
docker compose -f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" exec ipld-eth-db psql -U vdbm -d vulcanize_testing -AXqtc "SELECT * FROM eth.header_cids"
4 changes: 2 additions & 2 deletions statediff/indexer/database/sql/postgres/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func ResolveDriverType(str string) (DriverType, error) {
// DefaultConfig are default parameters for connecting to a Postgres sql
var DefaultConfig = Config{
Hostname: "localhost",
Port: 8066,
DatabaseName: "vulcanize_testing_v4",
Port: 8077,
DatabaseName: "vulcanize_testing",
Username: "vdbm",
Password: "password",
}
Expand Down

0 comments on commit 8fed0a9

Please sign in to comment.