@graphprotocol/graph-cli 0.43.1-alpha-20230320211532-95edea6 → 0.43.1-alpha-20230321032415-91f97ff
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/dist/commands/test.js +17 -17
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
-
## 0.43.1-alpha-
|
|
3
|
+
## 0.43.1-alpha-20230321032415-91f97ff
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- [#1201](https://github.com/graphprotocol/graph-tooling/pull/1201)
|
|
8
|
+
[`91f97ff`](https://github.com/graphprotocol/graph-tooling/commit/91f97ff8893d20d288e84312062f33060d5f0b4e)
|
|
9
|
+
Thanks [@saihaj](https://github.com/saihaj)! - read testsFolder from matchstick yaml and set the
|
|
10
|
+
paths based on that
|
|
11
|
+
|
|
7
12
|
- [#1201](https://github.com/graphprotocol/graph-tooling/pull/1201)
|
|
8
13
|
[`95edea6`](https://github.com/graphprotocol/graph-tooling/commit/95edea632dee687d18bcffa19d4108fe5da99a94)
|
|
9
14
|
Thanks [@saihaj](https://github.com/saihaj)! - make datasource and version optional args for test
|
package/dist/commands/test.js
CHANGED
|
@@ -15,28 +15,16 @@ const semver_1 = __importDefault(require("semver"));
|
|
|
15
15
|
class TestCommand extends core_1.Command {
|
|
16
16
|
async run() {
|
|
17
17
|
const { args: { datasource }, flags: { coverage, docker, force, logs, recompile, version }, } = await this.parse(TestCommand);
|
|
18
|
-
|
|
19
|
-
const cachePath = path_1.default.resolve(testsDir, '.latest.json');
|
|
20
|
-
const opts = {
|
|
21
|
-
testsDir,
|
|
22
|
-
cachePath,
|
|
23
|
-
coverage,
|
|
24
|
-
docker,
|
|
25
|
-
force,
|
|
26
|
-
logs,
|
|
27
|
-
recompile,
|
|
28
|
-
version,
|
|
29
|
-
latestVersion: getLatestVersionFromCache(cachePath),
|
|
30
|
-
};
|
|
18
|
+
let testsDir = './tests';
|
|
31
19
|
// Check if matchstick.yaml config exists
|
|
32
20
|
if (gluegun_1.filesystem.exists('matchstick.yaml')) {
|
|
33
21
|
try {
|
|
34
22
|
// Load the config
|
|
35
23
|
const config = await js_yaml_1.default.load(gluegun_1.filesystem.read('matchstick.yaml', 'utf8'));
|
|
36
|
-
// Check if matchstick.yaml and
|
|
37
|
-
if (config?.
|
|
24
|
+
// Check if matchstick.yaml and testsFolder not null
|
|
25
|
+
if (config?.testsFolder) {
|
|
38
26
|
// assign test folder from matchstick.yaml if present
|
|
39
|
-
|
|
27
|
+
testsDir = config.testsFolder;
|
|
40
28
|
}
|
|
41
29
|
}
|
|
42
30
|
catch (error) {
|
|
@@ -45,6 +33,18 @@ class TestCommand extends core_1.Command {
|
|
|
45
33
|
});
|
|
46
34
|
}
|
|
47
35
|
}
|
|
36
|
+
const cachePath = path_1.default.resolve(testsDir, '.latest.json');
|
|
37
|
+
const opts = {
|
|
38
|
+
testsDir,
|
|
39
|
+
cachePath,
|
|
40
|
+
coverage,
|
|
41
|
+
docker,
|
|
42
|
+
force,
|
|
43
|
+
logs,
|
|
44
|
+
recompile,
|
|
45
|
+
version,
|
|
46
|
+
latestVersion: getLatestVersionFromCache(cachePath),
|
|
47
|
+
};
|
|
48
48
|
// Fetch the latest version tag if version is not specified with -v/--version or if the version is not cached
|
|
49
49
|
if (opts.force || (!opts.version && !opts.latestVersion)) {
|
|
50
50
|
this.log('Fetching latest version tag...');
|
|
@@ -200,7 +200,7 @@ async function runDocker(datasource, opts) {
|
|
|
200
200
|
// Get current working directory
|
|
201
201
|
const current_folder = gluegun_1.filesystem.cwd();
|
|
202
202
|
// Declate dockerfilePath with default location
|
|
203
|
-
const dockerfilePath = path_1.default.join(opts.testsDir
|
|
203
|
+
const dockerfilePath = path_1.default.join(opts.testsDir, '.docker/Dockerfile');
|
|
204
204
|
// Check if the Dockerfil already exists
|
|
205
205
|
const dockerfileExists = gluegun_1.filesystem.exists(dockerfilePath);
|
|
206
206
|
// Generate the Dockerfile only if it doesn't exists,
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED