commit e24400e5206e3c3a579399dff634a89328a64780
parent 5bfb673fe313ed99b0abff24fe5a3daba002a6bb
Author: Florian Dold <florian@dold.me>
Date: Wed, 14 May 2025 01:51:39 +0200
harness WIP
Diffstat:
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts
@@ -497,6 +497,7 @@ export class GlobalTestState {
logger.trace(`killing process ${p.proc.pid}`);
p.proc.kill("SIGTERM");
await p.wait();
+ logger.trace(`done waiting for ${p.proc.pid}`);
}
}
}
diff --git a/packages/taler-harness/src/index.ts b/packages/taler-harness/src/index.ts
@@ -1496,6 +1496,8 @@ talerHarnessCli
help: "Do not time out tests.",
})
.action(async (args) => {
+ const noTimeout =
+ process.env["TALER_TEST_NO_TIMEOUT"] === "1" ? true : undefined;
await runTests({
includePattern: args.runIntegrationtests.pattern,
failFast: args.runIntegrationtests.failFast,
@@ -1504,7 +1506,7 @@ talerHarnessCli
dryRun: args.runIntegrationtests.dryRun,
verbosity: args.runIntegrationtests.quiet ? 0 : 1,
includeExperimental: args.runIntegrationtests.experimental ?? false,
- noTimeout: args.runIntegrationtests.noTimeout,
+ noTimeout: noTimeout ?? args.runIntegrationtests.noTimeout,
testDir: args.runIntegrationtests.testDir,
});
});
diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts b/packages/taler-harness/src/integrationtests/testrunner.ts
@@ -14,7 +14,12 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-import { CancellationToken, Logger, minimatch } from "@gnu-taler/taler-util";
+import {
+ CancellationToken,
+ Logger,
+ minimatch,
+ setGlobalLogLevelFromString,
+} from "@gnu-taler/taler-util";
import * as child_process from "child_process";
import { spawnSync } from "child_process";
import * as fs from "node:fs";
@@ -513,6 +518,7 @@ export async function runTests(spec: TestRunSpec) {
currentChild = child_process.fork(myFilename, ["__TWCLI_TESTWORKER"], {
env: {
TWCLI_RUN_TEST_INSTRUCTION: JSON.stringify(testInstr),
+ TWCLI_LOGLEVEL: logger.getGlobalLogLevel(),
...process.env,
},
stdio: ["pipe", "pipe", "pipe", "ipc"],
@@ -699,8 +705,10 @@ export function getTestInfo(): TestInfo[] {
const runTestInstrStr = process.env["TWCLI_RUN_TEST_INSTRUCTION"];
if (runTestInstrStr && process.argv.includes("__TWCLI_TESTWORKER")) {
+ setGlobalLogLevelFromString(process.env["TWCLI_LOGLEVEL"] ?? "INFO");
// Test will call taler-wallet-cli, so we must not propagate this variable.
delete process.env["TWCLI_RUN_TEST_INSTRUCTION"];
+ delete process.env["TWCLI_LOGLEVEL"];
const { testRootDir, testName } = JSON.parse(
runTestInstrStr,
) as RunTestChildInstruction;