gdharness 0.5.1 → 0.5.2
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/build/cli.js +19 -4
- package/build/index.js +19 -4
- package/package.json +1 -1
package/build/cli.js
CHANGED
|
@@ -160,6 +160,19 @@ function runArguments(options) {
|
|
|
160
160
|
function editorArguments(projectPath) {
|
|
161
161
|
return ["-e", "--path", projectPath];
|
|
162
162
|
}
|
|
163
|
+
function userDataIn(home, variables = process.env) {
|
|
164
|
+
const moved = ["APPDATA", "XDG_DATA_HOME"];
|
|
165
|
+
const carried = {};
|
|
166
|
+
for (const [name, value] of Object.entries(variables)) {
|
|
167
|
+
if (!moved.some((named) => named.toLowerCase() === name.toLowerCase())) {
|
|
168
|
+
carried[name] = value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
for (const named of moved) {
|
|
172
|
+
carried[named] = home;
|
|
173
|
+
}
|
|
174
|
+
return carried;
|
|
175
|
+
}
|
|
163
176
|
|
|
164
177
|
// node_modules/yaml/dist/nodes/identity.js
|
|
165
178
|
var require_identity = __commonJS(function(exports) {
|
|
@@ -15338,7 +15351,7 @@ var init_tool_definitions = __esm(() => {
|
|
|
15338
15351
|
},
|
|
15339
15352
|
{
|
|
15340
15353
|
name: "project_test",
|
|
15341
|
-
description: "Runs the project's gdUnit4 tests headless and answers with every case: which failed, where, and what the assertion said. The class list is rebuilt first, so a suite written a moment ago is found. Needs gdUnit4 under addons/gdUnit4.",
|
|
15354
|
+
description: "Runs the project's gdUnit4 tests headless and answers with every case: which failed, where, and what the assertion said. The class list is rebuilt first, so a suite written a moment ago is found. On Windows and Linux the run gets a user:// of its own, so a suite that saves a game writes nowhere near the saves of the copy somebody plays. Needs gdUnit4 under addons/gdUnit4.",
|
|
15342
15355
|
parameters: {
|
|
15343
15356
|
projectPath: PROJECT_PATH,
|
|
15344
15357
|
path: {
|
|
@@ -36422,7 +36435,8 @@ class GodotServer {
|
|
|
36422
36435
|
];
|
|
36423
36436
|
const timeoutMs = readPositiveNumber(args, "timeoutMs") ?? 600000;
|
|
36424
36437
|
this.logDebug(`Running tests: ${engine.value} ${cmdArgs.join(" ")}`);
|
|
36425
|
-
const
|
|
36438
|
+
const userData = mkdtempSync3(join12(tmpdir5(), "gdharness-tests-"));
|
|
36439
|
+
const run = this.spawnGame(engine.value, cmdArgs, userDataIn(userData));
|
|
36426
36440
|
const hung = await new Promise((resolve) => {
|
|
36427
36441
|
const timer = setTimeout(() => {
|
|
36428
36442
|
run.process.kill();
|
|
@@ -36450,6 +36464,7 @@ class GodotServer {
|
|
|
36450
36464
|
reportProblem = errorMessage(error);
|
|
36451
36465
|
} finally {
|
|
36452
36466
|
rmSync6(reportsDir, { recursive: true, force: true });
|
|
36467
|
+
rmSync6(userData, { recursive: true, force: true });
|
|
36453
36468
|
}
|
|
36454
36469
|
const engineEntries = run.log.select({ severity: "warning", sinceLastCall: false, limit: 200 }).entries;
|
|
36455
36470
|
const verdicts = {
|
|
@@ -36806,8 +36821,8 @@ class GodotServer {
|
|
|
36806
36821
|
}
|
|
36807
36822
|
running.process?.kill();
|
|
36808
36823
|
}
|
|
36809
|
-
spawnGame(godotPath, cmdArgs) {
|
|
36810
|
-
const child = spawn(godotPath, cmdArgs, { stdio: ["ignore", "pipe", "pipe"] });
|
|
36824
|
+
spawnGame(godotPath, cmdArgs, env) {
|
|
36825
|
+
const child = spawn(godotPath, cmdArgs, { stdio: ["ignore", "pipe", "pipe"], ...env ? { env } : {} });
|
|
36811
36826
|
const log = new GameLog;
|
|
36812
36827
|
const started = {
|
|
36813
36828
|
process: child,
|
package/build/index.js
CHANGED
|
@@ -25933,6 +25933,19 @@ function runArguments(options) {
|
|
|
25933
25933
|
function editorArguments(projectPath) {
|
|
25934
25934
|
return ["-e", "--path", projectPath];
|
|
25935
25935
|
}
|
|
25936
|
+
function userDataIn(home, variables = process.env) {
|
|
25937
|
+
const moved = ["APPDATA", "XDG_DATA_HOME"];
|
|
25938
|
+
const carried = {};
|
|
25939
|
+
for (const [name, value] of Object.entries(variables)) {
|
|
25940
|
+
if (!moved.some((named) => named.toLowerCase() === name.toLowerCase())) {
|
|
25941
|
+
carried[name] = value;
|
|
25942
|
+
}
|
|
25943
|
+
}
|
|
25944
|
+
for (const named of moved) {
|
|
25945
|
+
carried[named] = home;
|
|
25946
|
+
}
|
|
25947
|
+
return carried;
|
|
25948
|
+
}
|
|
25936
25949
|
|
|
25937
25950
|
// src/godot-path.ts
|
|
25938
25951
|
var run = promisify(execFile);
|
|
@@ -27767,7 +27780,7 @@ var TOOL_SPECS = [
|
|
|
27767
27780
|
},
|
|
27768
27781
|
{
|
|
27769
27782
|
name: "project_test",
|
|
27770
|
-
description: "Runs the project's gdUnit4 tests headless and answers with every case: which failed, where, and what the assertion said. The class list is rebuilt first, so a suite written a moment ago is found. Needs gdUnit4 under addons/gdUnit4.",
|
|
27783
|
+
description: "Runs the project's gdUnit4 tests headless and answers with every case: which failed, where, and what the assertion said. The class list is rebuilt first, so a suite written a moment ago is found. On Windows and Linux the run gets a user:// of its own, so a suite that saves a game writes nowhere near the saves of the copy somebody plays. Needs gdUnit4 under addons/gdUnit4.",
|
|
27771
27784
|
parameters: {
|
|
27772
27785
|
projectPath: PROJECT_PATH,
|
|
27773
27786
|
path: {
|
|
@@ -29221,7 +29234,8 @@ class GodotServer {
|
|
|
29221
29234
|
];
|
|
29222
29235
|
const timeoutMs = readPositiveNumber(args, "timeoutMs") ?? 600000;
|
|
29223
29236
|
this.logDebug(`Running tests: ${engine.value} ${cmdArgs.join(" ")}`);
|
|
29224
|
-
const
|
|
29237
|
+
const userData = mkdtempSync2(join7(tmpdir4(), "gdharness-tests-"));
|
|
29238
|
+
const run = this.spawnGame(engine.value, cmdArgs, userDataIn(userData));
|
|
29225
29239
|
const hung = await new Promise((resolve) => {
|
|
29226
29240
|
const timer = setTimeout(() => {
|
|
29227
29241
|
run.process.kill();
|
|
@@ -29249,6 +29263,7 @@ class GodotServer {
|
|
|
29249
29263
|
reportProblem = errorMessage(error);
|
|
29250
29264
|
} finally {
|
|
29251
29265
|
rmSync2(reportsDir, { recursive: true, force: true });
|
|
29266
|
+
rmSync2(userData, { recursive: true, force: true });
|
|
29252
29267
|
}
|
|
29253
29268
|
const engineEntries = run.log.select({ severity: "warning", sinceLastCall: false, limit: 200 }).entries;
|
|
29254
29269
|
const verdicts = {
|
|
@@ -29605,8 +29620,8 @@ class GodotServer {
|
|
|
29605
29620
|
}
|
|
29606
29621
|
running.process?.kill();
|
|
29607
29622
|
}
|
|
29608
|
-
spawnGame(godotPath, cmdArgs) {
|
|
29609
|
-
const child = spawn(godotPath, cmdArgs, { stdio: ["ignore", "pipe", "pipe"] });
|
|
29623
|
+
spawnGame(godotPath, cmdArgs, env) {
|
|
29624
|
+
const child = spawn(godotPath, cmdArgs, { stdio: ["ignore", "pipe", "pipe"], ...env ? { env } : {} });
|
|
29610
29625
|
const log = new GameLog;
|
|
29611
29626
|
const started = {
|
|
29612
29627
|
process: child,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdharness",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"mcpName": "io.github.Aureliolo/gdharness",
|
|
5
5
|
"description": "A harness for driving a Godot 4 project from an agent: editor addons, a runtime bridge into the running game, an MCP server in front of them, and a CLI that installs and diagnoses the Godot side.",
|
|
6
6
|
"type": "module",
|