Stop confirming removal of test tmp files

We stop asking for confirmation to remove the folders containing the
static generated fixtures. All the data is programatically generated so
it’s not a big deal if it is lost. In any case the data is retained
after a test run and only deleted before the next test run.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
This commit is contained in:
Thomas Scholtes
2023-11-23 16:47:14 +01:00
committed by Sebastian Martinez
parent 3d24c5f79f
commit 72fd099ecd
3 changed files with 0 additions and 35 deletions
@@ -2,7 +2,6 @@ import * as FsSync from "node:fs";
import * as Path from "node:path";
import {
assertRadInstalled,
promptWorkspaceRemoval,
removeWorkspace,
tmpDir,
} from "@tests/support/support.js";
@@ -30,9 +29,6 @@ export default async function globalSetup(): Promise<() => void> {
if (!process.env.SKIP_FIXTURE_CREATION) {
console.log("Setting up global test environment");
if (!process.env.CI) {
await promptWorkspaceRemoval();
}
await removeWorkspace();
const peerManager = await createPeerManager({
-4
View File
@@ -2,7 +2,6 @@ import * as FsSync from "node:fs";
import * as Path from "node:path";
import {
assertRadInstalled,
promptWorkspaceRemoval,
removeWorkspace,
tmpDir,
} from "@tests/support/support.js";
@@ -31,9 +30,6 @@ export default async function globalSetup(): Promise<() => void> {
if (!process.env.SKIP_FIXTURE_CREATION) {
console.log("Setting up global test environment");
if (!process.env.CI) {
await promptWorkspaceRemoval();
}
await removeWorkspace();
// Workaround for fixing MaxListenersExceededWarning.
-27
View File
@@ -5,7 +5,6 @@ import * as Crypto from "node:crypto";
import { fileURLToPath } from "node:url";
import * as Path from "node:path";
import * as Fs from "node:fs/promises";
import * as readline from "node:readline/promises";
// Generate string of 12 random characters with 8 bits of entropy.
export function randomTag(): string {
@@ -45,32 +44,6 @@ export async function assertRadInstalled(): Promise<void> {
}
}
export async function promptWorkspaceRemoval(): Promise<void> {
console.log("");
console.log("This will irrevocably destroy the following directories:");
console.log("");
workspacePaths.forEach(path => console.log(path));
console.log("");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
const result = await rl.question(
"Are you sure you want to continue? [yes/no]: ",
);
rl.close();
if (result.toLowerCase() === "yes") {
console.log("Done");
return;
}
console.log("Ok, I won't touch your data.");
process.exit(1);
}
export async function removeWorkspace(): Promise<void> {
for (const path of workspacePaths) {
await Fs.rm(path, {