Skip to content

Commit 14ac25c

Browse files
Make errors less loud in graph test (#1918)
* improve error handling
1 parent fe489e1 commit 14ac25c

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

.changeset/tricky-pumas-sip.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphprotocol/graph-cli': patch
3+
---
4+
5+
fix bug with loud errors in `graph test`

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66
branches:
77
- 'main'
8-
pull_request_target:
8+
pull_request:
99

1010
jobs:
1111
lint:

packages/cli/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"version": "0.94.0",
44
"type": "module",
55
"description": "CLI for building for and deploying to The Graph",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/graphprotocol/graph-tooling.git",
9+
"directory": "packages/cli"
10+
},
611
"license": "(Apache-2.0 OR MIT)",
712
"engines": {
813
"node": ">=20.18.1"
@@ -75,11 +80,6 @@
7580
"access": "public",
7681
"provenance": true
7782
},
78-
"repository": {
79-
"type": "git",
80-
"url": "https://github.com/graphprotocol/graph-tooling.git",
81-
"directory": "packages/cli"
82-
},
8383
"oclif": {
8484
"bin": "graph",
8585
"commands": "./dist/commands",

packages/cli/src/commands/test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ export default class TestCommand extends Command {
113113
}
114114

115115
if (opts.docker) {
116-
runDocker.bind(this)(datasource, opts);
116+
await runDocker.bind(this)(datasource, opts);
117117
} else {
118-
runBinary.bind(this)(datasource, opts);
118+
await runBinary.bind(this)(datasource, opts);
119119
}
120120
}
121121
}
@@ -190,7 +190,7 @@ async function runBinary(
190190
const child = spawn(binPath, args, { stdio: 'inherit' });
191191
const [code] = await events.once(child, 'exit');
192192
if (code !== 0) {
193-
this.error('Matchstick failed', { exit: 1 });
193+
this.error('Matchstick exited with an error', { exit: 1 });
194194
}
195195
}
196196

packages/ts/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"name": "@graphprotocol/graph-ts",
33
"version": "0.37.0",
44
"description": "TypeScript/AssemblyScript library for writing subgraph mappings for The Graph",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/graphprotocol/graph-tooling.git",
8+
"directory": "packages/ts"
9+
},
510
"main": "index.ts",
611
"module": "index.ts",
712
"types": "index.ts",
@@ -11,16 +16,11 @@
1116
"lint": "prettier -c **/*.{js,mjs,ts}",
1217
"test": "node test/test.mjs"
1318
},
19+
"dependencies": {
20+
"assemblyscript": "0.27.31"
21+
},
1422
"publishConfig": {
1523
"access": "public",
1624
"provenance": true
17-
},
18-
"repository": {
19-
"type": "git",
20-
"url": "https://github.com/graphprotocol/graph-tooling.git",
21-
"directory": "packages/ts"
22-
},
23-
"dependencies": {
24-
"assemblyscript": "0.27.31"
2525
}
2626
}

0 commit comments

Comments
 (0)