mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 07:33:12 +09:00
Replace SILENT_TEST and VERBOSE_TEST with TEST_OUTPUT
The reporter now handles all three modes: verbose prints everything, normal prints output from failing tests and hooks, silent prints only the results. The integration spawn helper and setup_logging no longer filter output themselves. npm install output in plugin install now goes through the logger instead of inherited stdio, so it follows the log level and is captured in tests like the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
838a43428b
commit
6363f15cb9
7 files changed
+32
-33
No files matched your search
@@ -297,16 +297,8 @@ export async function writeHostConfig(configPath, pairing, fields = {}) {
|
||||
/** @returns {Promise<child_process.ChildProcess>} */
|
||||
export function spawn(name, cmd, waitFor, options = {}) {
|
||||
|
||||
const silent = process.env.SILENT_TEST;
|
||||
const bootstrap = !controllerProcess || !hostProcess;
|
||||
function log(...args) {
|
||||
if (!silent || bootstrap) {
|
||||
console.log(...args);
|
||||
}
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
log(cmd);
|
||||
console.log(cmd);
|
||||
let parts = cmd.split(" ");
|
||||
let process = child_process.spawn(parts[0], parts.slice(1), childOptions(options));
|
||||
let stdout = new LineSplitter({ readableObjectMode: true });
|
||||
@@ -314,13 +306,9 @@ export function spawn(name, cmd, waitFor, options = {}) {
|
||||
let onData = line => {
|
||||
line = line.toString("utf8");
|
||||
if (waitFor.test(line)) {
|
||||
if (silent) {
|
||||
stdout.off("data", onData);
|
||||
stderr.off("data", onData);
|
||||
}
|
||||
resolve(process);
|
||||
}
|
||||
log(name, line);
|
||||
console.log(name, line);
|
||||
};
|
||||
stdout.on("data", onData);
|
||||
stderr.on("data", onData);
|
||||
@@ -336,12 +324,6 @@ export function spawnNode(name, cmd, waitFor, options) {
|
||||
before(async function() {
|
||||
this.timeout(40000);
|
||||
|
||||
|
||||
const silent = process.env.SILENT_TEST;
|
||||
if (silent) {
|
||||
console.log("SILENT_TEST is present in env, loggers after bootstrap will be muted.");
|
||||
}
|
||||
|
||||
// If fast test is enabled then output that it is
|
||||
|
||||
if (process.env.FAST_TEST) {
|
||||
|
||||
Reference in new issue
Block a user