Skip to content

Commit 53a8193

Browse files
authored
chore(test): parallel test execution! 🏎️ (#8919)
1 parent 14b96df commit 53a8193

File tree

85 files changed

+2833
-2134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2833
-2134
lines changed

.changeset/quick-pigs-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"builder-util": patch
3+
---
4+
5+
chore(test): parallel test execution! Updates base Logger to squelch noisy/concurrent logging when VITEST env var and DEBUG=electron-builder are set.

packages/builder-util/src/log.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ export type LogLevel = "info" | "warn" | "debug" | "notice" | "error"
2020
export const PADDING = 2
2121

2222
export class Logger {
23-
constructor(protected readonly stream: WritableStream) {}
23+
// clean up logs since concurrent tests are impossible to track logic execution with console concurrency "noise"
24+
private readonly shouldDisableNonErrorLoggingVitest = process.env.VITEST && !this.isDebugEnabled
25+
26+
constructor(protected readonly stream: WritableStream) {
27+
if (this.shouldDisableNonErrorLoggingVitest) {
28+
this.log(`non-error logging is silenced during VITEST workfloww when DEBUG=electron-builder flag is not set`)
29+
}
30+
}
2431

2532
messageTransformer: (message: string, level: LogLevel) => string = it => it
2633

@@ -61,6 +68,10 @@ export class Logger {
6168
}
6269

6370
private _doLog(message: string | Error, fields: Fields | null, level: LogLevel) {
71+
if (this.shouldDisableNonErrorLoggingVitest && level !== "error") {
72+
return // ignore info/warn message during VITEST workflow if debug flag is disabled
73+
}
74+
6475
// noinspection SuspiciousInstanceOfGuard
6576
if (message instanceof Error) {
6677
message = message.stack || message.toString()

0 commit comments

Comments
 (0)