Skip to content

Commit ab39b05

Browse files
committed
fix(ci): do not set --verbose by default
1 parent b0ed2fa commit ab39b05

File tree

2 files changed

+20
-55
lines changed

2 files changed

+20
-55
lines changed

packages/ci/src/lib/run-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ export async function createRunEnv(
6969
options: Options | undefined,
7070
git: SimpleGit,
7171
): Promise<RunEnv> {
72+
const inferredVerbose: boolean = Boolean(
73+
options?.debug === true || options?.silent === false,
74+
);
7275
// eslint-disable-next-line functional/immutable-data
73-
process.env['CP_VERBOSE'] = options?.silent ? 'false' : 'true';
76+
process.env['CP_VERBOSE'] = `${inferredVerbose}`;
7477

7578
const [head, base] = await Promise.all([
7679
normalizeGitRef(refs.head, git),

packages/ci/src/lib/run.int.test.ts

Lines changed: 16 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,13 @@ describe('runInCI', () => {
250250
expect(utils.executeProcess).toHaveBeenCalledTimes(2);
251251
expect(utils.executeProcess).toHaveBeenNthCalledWith(1, {
252252
command: options.bin,
253-
args: [
254-
'print-config',
255-
'--verbose',
256-
expect.stringMatching(/^--output=.*\.json$/),
257-
],
253+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
258254
cwd: workDir,
259255
observer: expectedObserver,
260256
} satisfies utils.ProcessConfig);
261257
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
262258
command: options.bin,
263-
args: ['--verbose', '--persist.format=json', '--persist.format=md'],
259+
args: ['--persist.format=json', '--persist.format=md'],
264260
cwd: workDir,
265261
observer: expectedObserver,
266262
} satisfies utils.ProcessConfig);
@@ -332,41 +328,32 @@ describe('runInCI', () => {
332328
expect(utils.executeProcess).toHaveBeenCalledTimes(5);
333329
expect(utils.executeProcess).toHaveBeenNthCalledWith(1, {
334330
command: options.bin,
335-
args: [
336-
'print-config',
337-
'--verbose',
338-
expect.stringMatching(/^--output=.*\.json$/),
339-
],
331+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
340332
cwd: workDir,
341333
observer: expectedObserver,
342334
} satisfies utils.ProcessConfig);
343335
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
344336
command: options.bin,
345-
args: ['--verbose', '--persist.format=json', '--persist.format=md'],
337+
args: ['--persist.format=json', '--persist.format=md'],
346338
cwd: workDir,
347339
observer: expectedObserver,
348340
} satisfies utils.ProcessConfig);
349341
expect(utils.executeProcess).toHaveBeenNthCalledWith(3, {
350342
command: options.bin,
351-
args: [
352-
'print-config',
353-
'--verbose',
354-
expect.stringMatching(/^--output=.*\.json$/),
355-
],
343+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
356344
cwd: workDir,
357345
observer: expectedObserver,
358346
} satisfies utils.ProcessConfig);
359347
expect(utils.executeProcess).toHaveBeenNthCalledWith(4, {
360348
command: options.bin,
361-
args: ['--verbose', '--persist.format=json', '--persist.format=md'],
349+
args: ['--persist.format=json', '--persist.format=md'],
362350
cwd: workDir,
363351
observer: expectedObserver,
364352
} satisfies utils.ProcessConfig);
365353
expect(utils.executeProcess).toHaveBeenNthCalledWith(5, {
366354
command: options.bin,
367355
args: [
368356
'compare',
369-
'--verbose',
370357
`--before=${path.join(outputDir, '.previous/report.json')}`,
371358
`--after=${path.join(outputDir, '.current/report.json')}`,
372359
'--persist.format=json',
@@ -425,25 +412,20 @@ describe('runInCI', () => {
425412
expect(utils.executeProcess).toHaveBeenCalledTimes(3);
426413
expect(utils.executeProcess).toHaveBeenNthCalledWith(1, {
427414
command: options.bin,
428-
args: [
429-
'print-config',
430-
'--verbose',
431-
expect.stringMatching(/^--output=.*\.json$/),
432-
],
415+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
433416
cwd: workDir,
434417
observer: expectedObserver,
435418
} satisfies utils.ProcessConfig);
436419
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
437420
command: options.bin,
438-
args: ['--verbose', '--persist.format=json', '--persist.format=md'],
421+
args: ['--persist.format=json', '--persist.format=md'],
439422
cwd: workDir,
440423
observer: expectedObserver,
441424
} satisfies utils.ProcessConfig);
442425
expect(utils.executeProcess).toHaveBeenNthCalledWith(3, {
443426
command: options.bin,
444427
args: [
445428
'compare',
446-
'--verbose',
447429
`--before=${path.join(outputDir, '.previous/report.json')}`,
448430
`--after=${path.join(outputDir, '.current/report.json')}`,
449431
'--persist.format=json',
@@ -617,17 +599,13 @@ describe('runInCI', () => {
617599
).toHaveLength(4); // 1 autorun for all projects, 3 print-configs for each project
618600
expect(utils.executeProcess).toHaveBeenCalledWith({
619601
command: run,
620-
args: [
621-
'print-config',
622-
'--verbose',
623-
expect.stringMatching(/^--output=.*\.json$/),
624-
],
602+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
625603
cwd: expect.stringContaining(workDir),
626604
observer: expectedObserver,
627605
} satisfies utils.ProcessConfig);
628606
expect(utils.executeProcess).toHaveBeenCalledWith({
629607
command: runMany,
630-
args: ['--verbose', '--persist.format=json', '--persist.format=md'],
608+
args: ['--persist.format=json', '--persist.format=md'],
631609
cwd: expect.stringContaining(workDir),
632610
observer: expectedObserver,
633611
} satisfies utils.ProcessConfig);
@@ -779,25 +757,20 @@ describe('runInCI', () => {
779757
).toHaveLength(10);
780758
expect(utils.executeProcess).toHaveBeenCalledWith({
781759
command: run,
782-
args: [
783-
'print-config',
784-
'--verbose',
785-
expect.stringMatching(/^--output=.*\.json$/),
786-
],
760+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
787761
cwd: expect.stringContaining(workDir),
788762
observer: expectedObserver,
789763
} satisfies utils.ProcessConfig);
790764
expect(utils.executeProcess).toHaveBeenCalledWith({
791765
command: runMany,
792-
args: ['--verbose', '--persist.format=json', '--persist.format=md'],
766+
args: ['--persist.format=json', '--persist.format=md'],
793767
cwd: expect.stringContaining(workDir),
794768
observer: expectedObserver,
795769
} satisfies utils.ProcessConfig);
796770
expect(utils.executeProcess).toHaveBeenCalledWith({
797771
command: run,
798772
args: [
799773
'compare',
800-
'--verbose',
801774
expect.stringMatching(/^--before=.*\.previous[/\\]report\.json$/),
802775
expect.stringMatching(/^--after=.*\.current[/\\]report\.json$/),
803776
expect.stringMatching(/^--label=\w+$/),
@@ -811,7 +784,6 @@ describe('runInCI', () => {
811784
command: run,
812785
args: [
813786
'merge-diffs',
814-
'--verbose',
815787
expect.stringMatching(
816788
/^--files=.*[/\\]cli[/\\]\.comparison[/\\]report-diff\.json$/,
817789
),
@@ -973,17 +945,13 @@ describe('runInCI', () => {
973945
).toHaveLength(6); // 3 autoruns and 3 print-configs for each project
974946
expect(utils.executeProcess).toHaveBeenCalledWith({
975947
command: options.bin,
976-
args: [
977-
'print-config',
978-
'--verbose',
979-
expect.stringMatching(/^--output=.*\.json$/),
980-
],
948+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
981949
cwd: expect.stringContaining(workDir),
982950
observer: expectedObserver,
983951
} satisfies utils.ProcessConfig);
984952
expect(utils.executeProcess).toHaveBeenCalledWith({
985953
command: options.bin,
986-
args: ['--verbose', '--persist.format=json', '--persist.format=md'],
954+
args: ['--persist.format=json', '--persist.format=md'],
987955
cwd: expect.stringContaining(workDir),
988956
observer: expectedObserver,
989957
} satisfies utils.ProcessConfig);
@@ -1146,25 +1114,20 @@ describe('runInCI', () => {
11461114
).toHaveLength(10);
11471115
expect(utils.executeProcess).toHaveBeenCalledWith({
11481116
command: options.bin,
1149-
args: [
1150-
'print-config',
1151-
'--verbose',
1152-
expect.stringMatching(/^--output=.*\.json$/),
1153-
],
1117+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
11541118
cwd: expect.stringContaining(workDir),
11551119
observer: expectedObserver,
11561120
} satisfies utils.ProcessConfig);
11571121
expect(utils.executeProcess).toHaveBeenCalledWith({
11581122
command: options.bin,
1159-
args: ['--verbose', '--persist.format=json', '--persist.format=md'],
1123+
args: ['--persist.format=json', '--persist.format=md'],
11601124
cwd: expect.stringContaining(workDir),
11611125
observer: expectedObserver,
11621126
} satisfies utils.ProcessConfig);
11631127
expect(utils.executeProcess).toHaveBeenCalledWith({
11641128
command: options.bin,
11651129
args: [
11661130
'compare',
1167-
'--verbose',
11681131
expect.stringMatching(/^--before=.*\.previous[/\\]report\.json$/),
11691132
expect.stringMatching(/^--after=.*\.current[/\\]report\.json$/),
11701133
expect.stringMatching(/^--label=\w+$/),
@@ -1178,7 +1141,6 @@ describe('runInCI', () => {
11781141
command: options.bin,
11791142
args: [
11801143
'merge-diffs',
1181-
'--verbose',
11821144
expect.stringMatching(
11831145
/^--files=.*api[/\\]\.comparison[/\\]report-diff\.json$/,
11841146
),

0 commit comments

Comments
 (0)