mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 09:02:41 +01:00
Protect active E2E test resources from cleanup
This commit is contained in:
+4
-1
@@ -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}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user