Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0260805
gnd(test): Migrate from monolithic test.rs to modular test/ structure
dimitrovmaksim Feb 5, 2026
25e5f5b
gnd(test): Add remaining test module files
dimitrovmaksim Feb 5, 2026
48cc6a8
gnd(test): Update module structure with new submodules
dimitrovmaksim Feb 5, 2026
333581c
gnd(test): Refactor runner.rs for readability - remove extracted code
dimitrovmaksim Feb 5, 2026
63d2345
gnd(test): Extract GraphQL assertion logic to dedicated module
dimitrovmaksim Feb 5, 2026
77956f2
gnd(test): Extract noop/stub trait implementations to dedicated module
dimitrovmaksim Feb 5, 2026
3099684
gnd(test): Add eth_call mocking and refactor test output
dimitrovmaksim Feb 11, 2026
665f072
gnd(test): Add EIP-1559 base fee support and refactor block creation
dimitrovmaksim Feb 12, 2026
8c6249e
gnd(test): Simplify test schema by auto-injecting block triggers
dimitrovmaksim Feb 12, 2026
038416a
gnd(test): Add support for manifests with startBlock > 0
dimitrovmaksim Feb 12, 2026
85fc735
gnd(test): Fix issues after rebase
dimitrovmaksim Feb 12, 2026
05ab2c5
gnd(test): Fix matchstick path
dimitrovmaksim Feb 13, 2026
3512429
gnd(test): Reuse load_manifest()
dimitrovmaksim Feb 13, 2026
448aadb
gnd(test): Add README, add important inline notes
dimitrovmaksim Feb 13, 2026
cd3992d
gnd: Fix missing fields, update readme
dimitrovmaksim Feb 13, 2026
6946165
gnd(test): Refactor CLI to accept test files/dirs as positional args
dimitrovmaksim Feb 13, 2026
0ddc69c
gnd(test): Fix diff colors — red for expected, green for actual
dimitrovmaksim Feb 16, 2026
14f141b
gnd(test): Support Array, FixedArray, and Tuple in Solidity type conv…
dimitrovmaksim Feb 16, 2026
ccbbed7
gnd(test): Recurse into subdirectories when discovering test files
dimitrovmaksim Feb 16, 2026
83fed7a
gnd(test): Validate eth_call parameter and return value counts
dimitrovmaksim Feb 16, 2026
9ab1baf
gnd(test): Ensure subgraph cleanup and remove FilterStoreEventEndedDrain
dimitrovmaksim Feb 16, 2026
8cfb64d
gnd(test): Validate datasource name to prevent shell injection in Doc…
dimitrovmaksim Feb 16, 2026
fc66da3
gnd(test): Replace unwrap/unimplemented with proper error handling
dimitrovmaksim Feb 16, 2026
54eab56
gnd(test): Fix ServerAddress initialization
dimitrovmaksim Feb 16, 2026
06ff5a7
gnd(test): Add verbose logging flag and extract manifest loading
dimitrovmaksim Feb 17, 2026
251bae9
gnd(test): Add integration test harness with pgtemp fixes
dimitrovmaksim Feb 17, 2026
dd9e18f
gnd(compiler): Look for asc binary in local if global does not exist.
dimitrovmaksim Feb 17, 2026
007aedb
gnd(test): Use --postgres-url for tests
dimitrovmaksim Feb 17, 2026
6e1c829
gnd(test): Fix test cleanup for --postgres-url
dimitrovmaksim Feb 17, 2026
5091829
gnd(test): Replace TempPgHandle with TestDatabase enum
dimitrovmaksim Feb 17, 2026
0cd9b5a
gnd(test): Clean up persistent DB state after each test
dimitrovmaksim Feb 17, 2026
24d45cd
gnd(test): Use Qm-prefixed SHA-1 hash as deployment hash
dimitrovmaksim Feb 17, 2026
0c4c50a
gnd(test): Fix stale docs after pre-test cleanup removal
dimitrovmaksim Feb 17, 2026
9bc4397
gnd(test): Rename and move README into docs/
dimitrovmaksim Feb 17, 2026
1c40079
gnd(test): Simplify TestResult, remove baseFeePerGas, fix timestamp d…
dimitrovmaksim Feb 18, 2026
9944093
gnd(test): Move docs to correct location under gnd/docs/
dimitrovmaksim Feb 18, 2026
4c6c033
gnd(test): Fix fixture contract address
dimitrovmaksim Feb 19, 2026
521379c
gnd(test): Fix AnyTxEnvelope and AnyHeader types in trigger.rs
dimitrovmaksim Feb 26, 2026
1093860
gnd(test): Address PR review comments
dimitrovmaksim Feb 26, 2026
6a8fae9
gnd(test): Document lowercase hex requirement for assertions
dimitrovmaksim Feb 26, 2026
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
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion gnd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,22 @@ path = "tests/cli_commands.rs"
name = "codegen_verification"
path = "tests/codegen_verification.rs"

[[test]]
name = "gnd_test"
path = "tests/gnd_test.rs"

[dependencies]
# Core graph dependencies
graph = { path = "../graph" }
graph-chain-ethereum = { path = "../chain/ethereum" }
graph-core = { path = "../core" }
graph-node = { path = "../node" }
graph-graphql = { path = "../graphql" }
graph-store-postgres = { path = "../store/postgres" }

# Test command dependencies
hex = "0.4"
async-trait = { workspace = true }

# Direct dependencies from current dev.rs
anyhow = { workspace = true }
Expand Down Expand Up @@ -49,6 +59,7 @@ thiserror = { workspace = true }
# Console output
indicatif = "0.18"
console = "0.16"
similar = "2"

# Code generation
graphql-tools = { workspace = true }
Expand Down Expand Up @@ -78,4 +89,3 @@ pgtemp = { git = "https://github.com/graphprotocol/pgtemp", branch = "initdb-arg
[dev-dependencies]
tempfile = "3"
walkdir = "2"
similar = "2"
40 changes: 31 additions & 9 deletions gnd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,25 +301,47 @@ Keys are stored in `~/.graph-cli.json`.

### `gnd test`

Run Matchstick tests for the subgraph.
Run subgraph tests.

```bash
gnd test [DATASOURCE]
gnd test [TEST_FILES...]
```

**Arguments:**
- `DATASOURCE`: Specific data source to test (optional)
- `PATHS`: Test JSON files or directories to scan. Defaults to `tests/` when nothing is specified.

**Flags:**

| Flag | Short | Description |
|------|-------|-------------|
| `--coverage` | `-c` | Run with coverage reporting |
| `--docker` | `-d` | Run in Docker container |
| `--force` | `-f` | Force redownload of Matchstick binary |
| `--logs` | `-l` | Show debug logs |
| `--recompile` | `-r` | Force recompilation before testing |
| `--version` | `-v` | Matchstick version to use |
| `--manifest` | `-m` | Path to subgraph manifest (default: `subgraph.yaml`) |
| `--skip-build` | `-s` | Skip building the subgraph before testing |
| `--postgres-url` | | PostgreSQL connection URL (env: `POSTGRES_URL`) |
| `--matchstick` | | Use legacy Matchstick runner (**deprecated** — migrate to JSON-based tests) |
| `--docker` | `-d` | Run Matchstick in Docker (requires `--matchstick`) |
| `--coverage` | `-c` | Run with coverage reporting (requires `--matchstick`) |
| `--recompile` | `-r` | Force recompilation (requires `--matchstick`) |
| `--force` | `-f` | Force redownload of Matchstick binary (requires `--matchstick`) |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to communicate somehow that we want to get rid of Matchstick and give people a bit of time to migrate their tests - it really feels like nobody is using it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a warn notification when using matchstick, also add a note about that in the docs.


**Examples:**

```bash
# Run all tests in tests/ directory (default)
gnd test

# Run specific test files
gnd test transfer.json approval.json
gnd test tests/transfer.json

# Scan a custom directory
gnd test my-tests/

# Use a different manifest
gnd test -m subgraph.staging.yaml tests/transfer.json

# Skip automatic build
gnd test -s
```

### `gnd clean`

Expand Down
Loading