devrock-gametests 0.1.0 → 0.1.1
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/README.md +2 -0
- package/dist/server.js +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -151,6 +151,8 @@ The run fails if any server has a failed test, a content-log line that is not ha
|
|
|
151
151
|
|
|
152
152
|
A content-log line is harmless if it is at INFO level, or if it is a line that BDS prints in clean runs. Before the first test starts, each server waits for the test area's chunks to load. The probe that checks them prints `Cannot access blocks outside of the world`, and that line passes only while the probe runs. At any other time, the same line fails the run. When no test has `TEST_TAG`, the two lines the engine prints to say so pass too.
|
|
153
153
|
|
|
154
|
+
The content log is what the server prints. What Podman prints itself, such as the warning rootless Podman gives on a host with no systemd user session, isn't part of it and never fails a run. The runner prints each such line with `Podman` and the server's number, and the server's log keeps it.
|
|
155
|
+
|
|
154
156
|
A full run and a named run both wait until each test has failed an attempt or passed as many as it needs, and no test has an attempt or rotation left open. The test pack tells the runner how many passes each test needs, from the last values it gave `requiredSuccessfulAttempts` and `rotateTest`. A rotated test needs that many passes in each of its 4 rotations. A test short of them never passes: it fails with the number it passed. The engine loads a test's next attempt just after the last attempt's verdict, about 150 ms later on BDS 1.26.66.1, so the runner treats a run as finished once it has looked complete for 1 second. A failed attempt also fails the content log.
|
|
155
157
|
|
|
156
158
|
BDS prints each argument of a `console` call or `print` as `String(argument)`, and each line after a line break on its own, with no level. To keep those lines from looking like the engine's own lines, the test pack and the copy of the behavior pack patch `console` and `print`. The patch starts each of those lines with ` | `, and the runner reads such a line as part of the message before it.
|
package/dist/server.js
CHANGED
|
@@ -54,9 +54,13 @@ export class BedrockServer {
|
|
|
54
54
|
mkdirSync(path.dirname(logFile), { recursive: true });
|
|
55
55
|
this.log = createWriteStream(logFile);
|
|
56
56
|
this.child = spawn('podman', runArgs(this.name, image, serverDir), { windowsHide: true });
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
createInterface({ input: this.child.stdout }).on('line', (line) => this.record(line));
|
|
58
|
+
// BDS prints everything, the content log too, on stdout, so stderr holds what Podman says itself, such as a
|
|
59
|
+
// warning about its setup. That isn't the content log, so it never fails a run, but the user should see it.
|
|
60
|
+
createInterface({ input: this.child.stderr }).on('line', (line) => {
|
|
61
|
+
this.log.write(`podman| ${line}\n`);
|
|
62
|
+
console.error(`[devrock-gametests] Podman${label ? ` (server ${label.trim()})` : ''}: ${line}`);
|
|
63
|
+
});
|
|
60
64
|
running.add(this.name);
|
|
61
65
|
// A write after the container is gone fails with EPIPE, which with no listener would crash the runner. `send`
|
|
62
66
|
// already refuses once the client has exited, and the close below ends the server.
|