mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 22:51:17 -05:00
Sanitize rush progress numbers in docker test output (#32029)
This commit is contained in:
@@ -157,7 +157,7 @@ ${sanitizeDockerfileOutput(result.stderr.toString())}`;
|
||||
}
|
||||
|
||||
function sanitizeDockerfileOutput(result: string): string {
|
||||
return stripAbsoluteImportPaths(sanitizeTimestamps(stripANSIEscapes(normalizeNewlines(result))));
|
||||
return stripAbsoluteImportPaths(sanitizeTimestamps(stripRushStageNumbers(stripANSIEscapes(normalizeNewlines(result)))));
|
||||
}
|
||||
|
||||
function normalizeNewlines(result: string): string {
|
||||
@@ -168,6 +168,10 @@ function stripANSIEscapes(result: string): string {
|
||||
return result.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "");
|
||||
}
|
||||
|
||||
function stripRushStageNumbers(result: string): string {
|
||||
return result.replace(/\d+ of \d+:/g, "XX of XX:");
|
||||
}
|
||||
|
||||
function sanitizeTimestamps(result: string): string {
|
||||
return result.replace(/\[\d?\d:\d\d:\d\d (A|P)M\]/g, "[XX:XX:XX XM]")
|
||||
.replace(/\d+(\.\d+)? seconds?/g, "? seconds")
|
||||
|
||||
Reference in New Issue
Block a user