Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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.

8 changes: 7 additions & 1 deletion gnd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ 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 +55,7 @@ thiserror = { workspace = true }
# Console output
indicatif = "0.17"
console = "0.15"
similar = "2"

# Code generation
graphql-tools = { workspace = true }
Expand Down Expand Up @@ -78,4 +85,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` | | Skip building the subgraph before testing |
| `--postgres-url` | | PostgreSQL connection URL (env: `POSTGRES_URL`) |
| `--matchstick` | | Use legacy Matchstick runner |
| `--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`) |

**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 --skip-build
```

### `gnd clean`

Expand Down
261 changes: 0 additions & 261 deletions gnd/src/commands/test.rs

This file was deleted.

Loading
Loading