Skip to content

Commit 07d80ed

Browse files
committed
Strip more timestamps and versions from docker logs to better handle the more verbose logging from office-ui-fabric
1 parent f2146a6 commit 07d80ed

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/testRunner/externalCompileRunner.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,10 @@ function sanitizeDockerfileOutput(result: string): string {
166166
normalizeNewlines,
167167
stripANSIEscapes,
168168
stripRushStageNumbers,
169+
stripWebpackHash,
169170
sanitizeVersionSpecifiers,
170171
sanitizeTimestamps,
172+
sanitizeSizes,
171173
sanitizeUnimportantGulpOutput,
172174
stripAbsoluteImportPaths,
173175
].reduce((result, f) => f(result), result);
@@ -185,6 +187,14 @@ function stripRushStageNumbers(result: string): string {
185187
return result.replace(/\d+ of \d+:/g, "XX of XX:");
186188
}
187189

190+
function stripWebpackHash(result: string): string {
191+
return result.replace(/Hash: \w+/g, "Hash: [redacted]")
192+
}
193+
194+
function sanitizeSizes(result: string): string {
195+
return result.replace(/\d+(\.\d+)? ((Ki|M)B|bytes)/g, "X KiB");
196+
}
197+
188198
/**
189199
* Gulp's output order within a `parallel` block is nondeterministic (and there's no way to configure it to execute in series),
190200
* so we purge as much of the gulp output as we can
@@ -200,6 +210,7 @@ function sanitizeTimestamps(result: string): string {
200210
return result.replace(/\[\d?\d:\d\d:\d\d (A|P)M\]/g, "[XX:XX:XX XM]")
201211
.replace(/\[\d?\d:\d\d:\d\d\]/g, "[XX:XX:XX]")
202212
.replace(/\/\d+-\d+-[\d_TZ]+-debug.log/g, "\/XXXX-XX-XXXXXXXXX-debug.log")
213+
.replace(/\d+\/\d+\/\d+ \d+:\d+:\d+ (AM|PM)/g, "XX/XX/XX XX:XX:XX XM")
203214
.replace(/\d+(\.\d+)? sec(onds?)?/g, "? seconds")
204215
.replace(/\d+(\.\d+)? min(utes?)?/g, "")
205216
.replace(/\d+(\.\d+)? ?m?s/g, "?s")
@@ -210,7 +221,8 @@ function sanitizeVersionSpecifiers(result: string): string {
210221
return result
211222
.replace(/\d+.\d+.\d+-insiders.\d\d\d\d\d\d\d\d/g, "X.X.X-insiders.xxxxxxxx")
212223
.replace(/Rush Multi-Project Build Tool (\d+)\.\d+\.\d+/g, "Rush Multi-Project Build Tool $1.X.X")
213-
.replace(/([@v\()])\d+\.\d+\.\d+/g, "$1X.X.X");
224+
.replace(/([@v\()])\d+\.\d+\.\d+/g, "$1X.X.X")
225+
.replace(/webpack \d+\.\d+\.\d+/g, "$1.X.X");
214226
}
215227

216228
/**

0 commit comments

Comments
 (0)