-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from sygmaprotocol/mj52951/add-e2e-testing
feat: Add e2e testing
- Loading branch information
Showing
19 changed files
with
751 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DB_NAME=squid | ||
DB_PASS=squid | ||
DB_PORT=5432 | ||
DB_USERNAME=postgres | ||
DB_HOST=localhost | ||
|
||
SHARED_CONFIG_URL="https://ipfs.io/ipfs/bafkreiasnla2ya55of6nwm3swjstip4q2ixfa3t6tvixyibclfovxnerte" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: E2E Tests | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
- name: Install Node.js ${{ matrix.node-version }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Run Docker | ||
run: docker compose up --build -d | ||
- name: Wait | ||
run: sleep 80s | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Run tests | ||
run: yarn run test:e2e | ||
- name: Clean up Docker containers | ||
if: always() | ||
run: docker compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,73 @@ | ||
{ | ||
"$schema": "https://cdn.subsquid.io/schemas/commands.json", | ||
"commands": { | ||
"clean": { | ||
"description": "delete all build artifacts", | ||
"cmd": ["npx", "--yes", "rimraf", "lib"] | ||
}, | ||
"build": { | ||
"description": "Build the squid project", | ||
"deps": ["clean"], | ||
"cmd": ["tsc"] | ||
}, | ||
"up": { | ||
"description": "Start indexer", | ||
"cmd": [ | ||
"docker", | ||
"compose", | ||
"up", | ||
"-d" | ||
] | ||
}, | ||
"down": { | ||
"description": "Drop indexer", | ||
"cmd": [ | ||
"docker", | ||
"compose", | ||
"down" | ||
] | ||
}, | ||
"migration:apply": { | ||
"description": "Apply the DB migrations", | ||
"cmd": ["squid-typeorm-migration", "apply"] | ||
}, | ||
"migration:generate": { | ||
"description": "Generate a DB migration matching the TypeORM entities", | ||
"deps": ["migration:clean"], | ||
"cmd": ["squid-typeorm-migration", "generate"] | ||
}, | ||
"migration:clean": { | ||
"description": "Clean the migrations folder", | ||
"cmd": ["npx", "--yes", "rimraf", "./db/migrations/*.js"] | ||
}, | ||
"migration": { | ||
"cmd": ["squid-typeorm-migration", "generate"], | ||
"hidden": true | ||
}, | ||
"codegen": { | ||
"description": "Generate TypeORM entities from the schema file", | ||
"cmd": ["squid-typeorm-codegen"] | ||
}, | ||
"evm-typegen": { | ||
"description": "Generate data access classes for an ABI file(s) in the ./abi folder", | ||
"cmd": ["squid-evm-typegen", "./src/abi", {"glob": "./src/abi/*.json"}, "--multicall"] | ||
}, | ||
"substrate-typegen": { | ||
"description": "Generate data access classes for an substrate metadata", | ||
"cmd": ["squid-substrate-typegen", "./typegen.json"] | ||
}, | ||
"start-sepolia":{ | ||
"description": "Start Sepolia indexer", | ||
"deps": ["build", "migration:apply"], | ||
"cmd": ["node", "--require=dotenv/config", "lib/main.js", "dotenv_config_path=envs/.env.sepolia"] | ||
}, | ||
"start-holesky":{ | ||
"description": "Start Holesky indexer", | ||
"deps": ["build", "migration:apply"], | ||
"cmd": ["node", "--require=dotenv/config", "lib/main.js", "dotenv_config_path=envs/.env.holesky"] | ||
}, | ||
"process": { | ||
"description": "Load .env and start the squid processor", | ||
"deps": ["build", "migration:apply"], | ||
"cmd": ["node", "--require=dotenv/config", "lib/main.js"] | ||
}, | ||
"start-init": { | ||
"description": "Initialize the database and load config data", | ||
"deps": ["build", "migration:apply"], | ||
"cmd": ["node", "--require=dotenv/config", "lib/main_init.js"] | ||
}, | ||
"process:prod": { | ||
"description": "Start the squid processor", | ||
"cmd": ["node", "lib/main.js"], | ||
"hidden": true | ||
}, | ||
"check-updates": { | ||
"cmd": ["npx", "--yes", "npm-check-updates", "--filter=/subsquid/", "--upgrade"], | ||
"hidden": true | ||
}, | ||
"bump": { | ||
"description": "Bump @subsquid packages to the latest versions", | ||
"deps": ["check-updates"], | ||
"cmd": ["npm", "i", "-f"] | ||
}, | ||
"open": { | ||
"description": "Open a local browser window", | ||
"cmd": ["npx", "--yes", "opener"] | ||
} | ||
"$schema": "https://cdn.subsquid.io/schemas/commands.json", | ||
"commands": { | ||
"clean": { | ||
"description": "delete all build artifacts", | ||
"cmd": ["npx", "--yes", "rimraf", "lib"] | ||
}, | ||
"build": { | ||
"description": "Build the squid project", | ||
"deps": ["clean"], | ||
"cmd": ["tsc"] | ||
}, | ||
"up": { | ||
"description": "Start indexer", | ||
"cmd": [ | ||
"docker", | ||
"compose", | ||
"up", | ||
"-d" | ||
] | ||
}, | ||
"down": { | ||
"description": "Drop indexer", | ||
"cmd": [ | ||
"docker", | ||
"compose", | ||
"down" | ||
] | ||
}, | ||
"migration:apply": { | ||
"description": "Apply the DB migrations", | ||
"cmd": ["squid-typeorm-migration", "apply"] | ||
}, | ||
"migration:generate": { | ||
"description": "Generate a DB migration matching the TypeORM entities", | ||
"deps": ["migration:clean"], | ||
"cmd": ["squid-typeorm-migration", "generate"] | ||
}, | ||
"migration:clean": { | ||
"description": "Clean the migrations folder", | ||
"cmd": ["npx", "--yes", "rimraf", "./db/migrations/*.js"] | ||
}, | ||
"migration": { | ||
"cmd": ["squid-typeorm-migration", "generate"], | ||
"hidden": true | ||
}, | ||
"codegen": { | ||
"description": "Generate TypeORM entities from the schema file", | ||
"cmd": ["squid-typeorm-codegen"] | ||
}, | ||
"evm-typegen": { | ||
"description": "Generate data access classes for an ABI file(s) in the ./abi folder", | ||
"cmd": ["squid-evm-typegen", "./src/abi", {"glob": "./src/abi/*.json"}, "--multicall"] | ||
}, | ||
"substrate-typegen": { | ||
"description": "Generate data access classes for an substrate metadata", | ||
"cmd": ["squid-substrate-typegen", "./typegen.json"] | ||
}, | ||
"check-updates": { | ||
"cmd": ["npx", "--yes", "npm-check-updates", "--filter=/subsquid/", "--upgrade"], | ||
"hidden": true | ||
}, | ||
"bump": { | ||
"description": "Bump @subsquid packages to the latest versions", | ||
"deps": ["check-updates"], | ||
"cmd": ["npm", "i", "-f"] | ||
}, | ||
"open": { | ||
"description": "Open a local browser window", | ||
"cmd": ["npx", "--yes", "opener"] | ||
} | ||
} | ||
} |
10 changes: 7 additions & 3 deletions
10
db/migrations/1734354978596-Data.js → db/migrations/1734434955039-Data.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DB_NAME=squid | ||
DB_PASS=squid | ||
DB_PORT=5432 | ||
DB_USERNAME=postgres | ||
DB_HOST=db |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
DB_NAME=squid | ||
DB_PASS=squid | ||
DB_PORT=5432 | ||
DB_USERNAME=postgres | ||
DB_HOST=db | ||
START_SCRIPT_ENV=index | ||
|
||
PROCESSOR_PROMETHEUS_PORT=3000 | ||
|
||
SHARED_CONFIG_URL="https://ipfs.io/ipfs/bafkreiasnla2ya55of6nwm3swjstip4q2ixfa3t6tvixyibclfovxnerte" | ||
|
||
DOMAIN_ID=1 | ||
1_METADATA='{"rpcUrl": "http://evm1:8545"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
DB_NAME=squid | ||
DB_PASS=squid | ||
DB_PORT=5432 | ||
DB_USERNAME=postgres | ||
DB_HOST=db | ||
START_SCRIPT_ENV=index | ||
|
||
PROCESSOR_PROMETHEUS_PORT=3002 | ||
|
||
SHARED_CONFIG_URL="https://ipfs.io/ipfs/bafkreiasnla2ya55of6nwm3swjstip4q2ixfa3t6tvixyibclfovxnerte" | ||
|
||
DOMAIN_ID=2 | ||
2_METADATA='{"rpcUrl": "http://evm2:8545"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.