Protect active E2E test resources from cleanup

This commit is contained in:
Vsevolod Kukol
2026-09-11 22:07:07 +02:00
parent b16229d1f8
commit f8aad79af9
4 changed files with 72 additions and 25 deletions
+4 -1
View File
@@ -23,7 +23,10 @@ export function generateUniqueName(baseName: string, options?: TestNameOptions):
const timestamp = options?.timestampped === undefined ? true : options.timestampped;
const prefixed = options?.prefixed === undefined ? true : options.prefixed;
const prefix = prefixed ? "t_" : "";
const runId = process.env.GITHUB_RUN_ID;
const runAttempt = process.env.GITHUB_RUN_ATTEMPT ?? "1";
const runPrefix = runId ? `${runId}_${runAttempt}_` : "";
const prefix = prefixed ? `t_${runPrefix}` : "";
const suffix = timestamp ? `_${Date.now()}` : "";
return `${prefix}${baseName}${crypto.randomBytes(length).toString("hex")}${suffix}`;
}