Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 30 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ jobs:
ports:
- 5432:5432
env:
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings"
RUSTFLAGS: "-D warnings"
steps:
- name: Tune GitHub hosted runner to reduce flakiness
# https://github.com/smorimoto/tune-github-hosted-runner-network/blob/main/action.yml
run: sudo ethtool -K eth0 tx off rx off
- name: Checkout sources
uses: actions/checkout@v4
# Don't use the rust-cache as it leads to 'no space left on device' errors
# - uses: Swatinem/rust-cache@v2
- name: Install lld
run: sudo apt-get install -y lld protobuf-compiler
- uses: Swatinem/rust-cache@v2

- name: Install protoc
run: sudo apt-get install -y protobuf-compiler

- name: Run unit tests
uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -80,26 +80,30 @@ jobs:
- 5432:5432
env:
GRAPH_IPFS_REQUEST_TIMEOUT: "60"
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings --cfg test_with_ipfs"
RUSTFLAGS: "-D warnings --cfg test_with_ipfs"
RUNNER_TESTS_WAIT_FOR_SYNC_SECS: "600"
steps:
- name: Tune GitHub hosted runner to reduce flakiness
# https://github.com/smorimoto/tune-github-hosted-runner-network/blob/main/action.yml
run: sudo ethtool -K eth0 tx off rx off
- name: Checkout sources
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2

- name: Install protoc
run: sudo apt-get install -y protobuf-compiler

- name: Install Node 20
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: yarn
cache-dependency-path: "tests/runner-tests/yarn.lock"

- uses: Swatinem/rust-cache@v2
node-version: 20
cache: pnpm

- name: Install lld
run: sudo apt-get install -y lld protobuf-compiler
- name: Install Node.js dependencies
run: pnpm install

- name: Run runner tests
id: runner-tests-1
Expand Down Expand Up @@ -139,7 +143,7 @@ jobs:
ports:
- 3011:5432
env:
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings"
RUSTFLAGS: "-D warnings"
steps:
- name: Tune GitHub hosted runner to reduce flakiness
# https://github.com/smorimoto/tune-github-hosted-runner-network/blob/main/action.yml
Expand All @@ -148,15 +152,20 @@ jobs:
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2

- name: Install Node 20
- name: Install protoc
run: sudo apt-get install -y protobuf-compiler

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: yarn
cache-dependency-path: "tests/integration-tests/yarn.lock"
node-version: 20
cache: pnpm

- name: Install lld and jq
run: sudo apt-get install -y lld jq protobuf-compiler
- name: Install Node.js dependencies
run: pnpm install

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
THEGRAPH_STORE_POSTGRES_DIESEL_URL: "postgresql://postgres:postgres@localhost:5432/graph_node_test"
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -D warnings"
RUSTFLAGS: "-D warnings"
N_CONCURRENT_TESTS: "4"
TESTS_GANACHE_HARD_WAIT_SECONDS: "30"

Expand Down Expand Up @@ -41,14 +41,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install Node 14

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "14"
cache: yarn
cache-dependency-path: "tests/integration-tests/yarn.lock"
- name: Install lld
run: sudo apt-get install -y lld jq protobuf-compiler
node-version: 20
cache: pnpm

- name: Install Node.js dependencies
run: pnpm install

- name: Install protoc
run: sudo apt-get install -y protobuf-compiler

- uses: actions-rs/cargo@v1
with:
command: install
Expand Down
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ lcov.info

/tests/**/build
/tests/**/generated
/tests/**/node_modules
/tests/**/yarn-error.log
/tests/**/pnpm-lock.yaml

# Built solidity contracts.
/tests/**/bin
/tests/**/truffle_output
# Node dependencies
node_modules/

# Docker volumes and debug logs
.postgres
Expand Down
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Unit tests are inlined with source code.
**Prerequisites:**
1. PostgreSQL running on localhost:5432 (with initialised `graph-test` database)
2. IPFS running on localhost:5001
3. Yarn (v1)
3. PNPM
4. Foundry (for smart contract compilation)
5. Environment variable `THEGRAPH_STORE_POSTGRES_DIESEL_URL` set

Expand Down Expand Up @@ -56,7 +56,7 @@ cargo test <specific_test_name>
**Prerequisites:**
1. PostgreSQL running on localhost:5432 (with initialised `graph-test` database)
2. IPFS running on localhost:5001
3. Yarn (v1)
3. PNPM
4. Foundry (for smart contract compilation)
5. Environment variable `THEGRAPH_STORE_POSTGRES_DIESEL_URL` set

Expand Down Expand Up @@ -88,7 +88,7 @@ cargo test -p graph-tests --test runner_tests test_name -- --nocapture
1. PostgreSQL running on localhost:3011 (with initialised `graph-node` database)
2. IPFS running on localhost:3001
3. Anvil running on localhost:3021
4. Yarn (v1)
4. PNPM
5. Foundry (for smart contract compilation)
6. **Built graph-node binary** (integration tests require the compiled binary)

Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"private": true,
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
}
Loading
Loading