Skip to content

Commit ea81bb3

Browse files
committed
fix(ci): do not set --verbose by default
1 parent 25ad63e commit ea81bb3

File tree

2 files changed

+12
-55
lines changed

2 files changed

+12
-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: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -250,18 +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,
263259
args: [
264-
'--verbose',
265260
'--no-progress',
266261
'--persist.format=json',
267262
'--persist.format=md',
@@ -337,18 +332,13 @@ describe('runInCI', () => {
337332
expect(utils.executeProcess).toHaveBeenCalledTimes(5);
338333
expect(utils.executeProcess).toHaveBeenNthCalledWith(1, {
339334
command: options.bin,
340-
args: [
341-
'print-config',
342-
'--verbose',
343-
expect.stringMatching(/^--output=.*\.json$/),
344-
],
335+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
345336
cwd: workDir,
346337
observer: expectedObserver,
347338
} satisfies utils.ProcessConfig);
348339
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
349340
command: options.bin,
350341
args: [
351-
'--verbose',
352342
'--no-progress',
353343
'--persist.format=json',
354344
'--persist.format=md',
@@ -358,18 +348,13 @@ describe('runInCI', () => {
358348
} satisfies utils.ProcessConfig);
359349
expect(utils.executeProcess).toHaveBeenNthCalledWith(3, {
360350
command: options.bin,
361-
args: [
362-
'print-config',
363-
'--verbose',
364-
expect.stringMatching(/^--output=.*\.json$/),
365-
],
351+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
366352
cwd: workDir,
367353
observer: expectedObserver,
368354
} satisfies utils.ProcessConfig);
369355
expect(utils.executeProcess).toHaveBeenNthCalledWith(4, {
370356
command: options.bin,
371357
args: [
372-
'--verbose',
373358
'--no-progress',
374359
'--persist.format=json',
375360
'--persist.format=md',
@@ -381,7 +366,6 @@ describe('runInCI', () => {
381366
command: options.bin,
382367
args: [
383368
'compare',
384-
'--verbose',
385369
`--before=${path.join(outputDir, '.previous/report.json')}`,
386370
`--after=${path.join(outputDir, '.current/report.json')}`,
387371
'--persist.format=json',
@@ -440,18 +424,13 @@ describe('runInCI', () => {
440424
expect(utils.executeProcess).toHaveBeenCalledTimes(3);
441425
expect(utils.executeProcess).toHaveBeenNthCalledWith(1, {
442426
command: options.bin,
443-
args: [
444-
'print-config',
445-
'--verbose',
446-
expect.stringMatching(/^--output=.*\.json$/),
447-
],
427+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
448428
cwd: workDir,
449429
observer: expectedObserver,
450430
} satisfies utils.ProcessConfig);
451431
expect(utils.executeProcess).toHaveBeenNthCalledWith(2, {
452432
command: options.bin,
453433
args: [
454-
'--verbose',
455434
'--no-progress',
456435
'--persist.format=json',
457436
'--persist.format=md',
@@ -463,7 +442,6 @@ describe('runInCI', () => {
463442
command: options.bin,
464443
args: [
465444
'compare',
466-
'--verbose',
467445
`--before=${path.join(outputDir, '.previous/report.json')}`,
468446
`--after=${path.join(outputDir, '.current/report.json')}`,
469447
'--persist.format=json',
@@ -637,18 +615,13 @@ describe('runInCI', () => {
637615
).toHaveLength(4); // 1 autorun for all projects, 3 print-configs for each project
638616
expect(utils.executeProcess).toHaveBeenCalledWith({
639617
command: run,
640-
args: [
641-
'print-config',
642-
'--verbose',
643-
expect.stringMatching(/^--output=.*\.json$/),
644-
],
618+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
645619
cwd: expect.stringContaining(workDir),
646620
observer: expectedObserver,
647621
} satisfies utils.ProcessConfig);
648622
expect(utils.executeProcess).toHaveBeenCalledWith({
649623
command: runMany,
650624
args: [
651-
'--verbose',
652625
'--no-progress',
653626
'--persist.format=json',
654627
'--persist.format=md',
@@ -804,18 +777,13 @@ describe('runInCI', () => {
804777
).toHaveLength(10);
805778
expect(utils.executeProcess).toHaveBeenCalledWith({
806779
command: run,
807-
args: [
808-
'print-config',
809-
'--verbose',
810-
expect.stringMatching(/^--output=.*\.json$/),
811-
],
780+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
812781
cwd: expect.stringContaining(workDir),
813782
observer: expectedObserver,
814783
} satisfies utils.ProcessConfig);
815784
expect(utils.executeProcess).toHaveBeenCalledWith({
816785
command: runMany,
817786
args: [
818-
'--verbose',
819787
'--no-progress',
820788
'--persist.format=json',
821789
'--persist.format=md',
@@ -827,7 +795,6 @@ describe('runInCI', () => {
827795
command: run,
828796
args: [
829797
'compare',
830-
'--verbose',
831798
expect.stringMatching(/^--before=.*\.previous[/\\]report\.json$/),
832799
expect.stringMatching(/^--after=.*\.current[/\\]report\.json$/),
833800
expect.stringMatching(/^--label=\w+$/),
@@ -841,7 +808,6 @@ describe('runInCI', () => {
841808
command: run,
842809
args: [
843810
'merge-diffs',
844-
'--verbose',
845811
expect.stringMatching(
846812
/^--files=.*[/\\]cli[/\\]\.comparison[/\\]report-diff\.json$/,
847813
),
@@ -1003,18 +969,13 @@ describe('runInCI', () => {
1003969
).toHaveLength(6); // 3 autoruns and 3 print-configs for each project
1004970
expect(utils.executeProcess).toHaveBeenCalledWith({
1005971
command: options.bin,
1006-
args: [
1007-
'print-config',
1008-
'--verbose',
1009-
expect.stringMatching(/^--output=.*\.json$/),
1010-
],
972+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
1011973
cwd: expect.stringContaining(workDir),
1012974
observer: expectedObserver,
1013975
} satisfies utils.ProcessConfig);
1014976
expect(utils.executeProcess).toHaveBeenCalledWith({
1015977
command: options.bin,
1016978
args: [
1017-
'--verbose',
1018979
'--no-progress',
1019980
'--persist.format=json',
1020981
'--persist.format=md',
@@ -1181,18 +1142,13 @@ describe('runInCI', () => {
11811142
).toHaveLength(10);
11821143
expect(utils.executeProcess).toHaveBeenCalledWith({
11831144
command: options.bin,
1184-
args: [
1185-
'print-config',
1186-
'--verbose',
1187-
expect.stringMatching(/^--output=.*\.json$/),
1188-
],
1145+
args: ['print-config', expect.stringMatching(/^--output=.*\.json$/)],
11891146
cwd: expect.stringContaining(workDir),
11901147
observer: expectedObserver,
11911148
} satisfies utils.ProcessConfig);
11921149
expect(utils.executeProcess).toHaveBeenCalledWith({
11931150
command: options.bin,
11941151
args: [
1195-
'--verbose',
11961152
'--no-progress',
11971153
'--persist.format=json',
11981154
'--persist.format=md',
@@ -1204,7 +1160,6 @@ describe('runInCI', () => {
12041160
command: options.bin,
12051161
args: [
12061162
'compare',
1207-
'--verbose',
12081163
expect.stringMatching(/^--before=.*\.previous[/\\]report\.json$/),
12091164
expect.stringMatching(/^--after=.*\.current[/\\]report\.json$/),
12101165
expect.stringMatching(/^--label=\w+$/),
@@ -1218,7 +1173,6 @@ describe('runInCI', () => {
12181173
command: options.bin,
12191174
args: [
12201175
'merge-diffs',
1221-
'--verbose',
12221176
expect.stringMatching(
12231177
/^--files=.*api[/\\]\.comparison[/\\]report-diff\.json$/,
12241178
),

0 commit comments

Comments
 (0)