Skip to content

Commit 24195b7

Browse files
committed
fix: remove trailing space from statistics line for cross-platform consistency
The Statistics line in the execution summary had a trailing space that was preserved on macOS but trimmed by Windows ConPTY. Also updates the task-list 'vp run in script' E2E test to use expect-milestone + enter instead of timing out.
1 parent a2a7c8e commit 24195b7

50 files changed

Lines changed: 88 additions & 117 deletions

File tree

Some content is hidden

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

crates/vite_task/src/session/reporter/labeled.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,20 +380,19 @@ fn print_summary(
380380
};
381381

382382
// Build statistics line, only including non-empty parts
383-
// Note: trailing space after "cache misses" is intentional for consistent formatting
384383
let _ = write!(
385384
writer,
386-
"{} {} {} {} ",
385+
"{} {} {} {}",
387386
"Statistics:".style(Style::new().bold()),
388387
vite_str::format!(" {total} tasks").style(Style::new().bright_white()),
389388
vite_str::format!("• {cache_hits} cache hits").style(Style::new().green()),
390389
vite_str::format!("• {cache_misses} cache misses").style(CACHE_MISS_STYLE),
391390
);
392391
if !cache_disabled_str.is_empty() {
393-
let _ = write!(writer, "{cache_disabled_str} ");
392+
let _ = write!(writer, " {cache_disabled_str}");
394393
}
395394
if !failed_str.is_empty() {
396-
let _ = write!(writer, "{failed_str} ");
395+
let _ = write!(writer, " {failed_str}");
397396
}
398397
let _ = writeln!(writer);
399398

crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots/associate existing cache.snap

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache
54
---
65
> vp run script1 # cache miss
76
$ print hello
@@ -12,7 +11,7 @@ hello
1211
Vite+ Task RunnerExecution Summary
1312
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1413

15-
Statistics: 1 tasks0 cache hits1 cache misses
14+
Statistics: 1 tasks0 cache hits1 cache misses
1615
Performance: 0% cache hit rate
1716

1817
Task Details:
@@ -29,7 +28,7 @@ hello
2928
Vite+ Task RunnerExecution Summary
3029
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3130

32-
Statistics: 1 tasks1 cache hits0 cache misses
31+
Statistics: 1 tasks1 cache hits0 cache misses
3332
Performance: 100% cache hit rate, <duration> saved in total
3433

3534
Task Details:
@@ -48,7 +47,7 @@ world
4847
Vite+ Task Runner • Execution Summary
4948
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5049

51-
Statistics: 1 tasks • 0 cache hits • 1 cache misses
50+
Statistics: 1 tasks • 0 cache hits • 1 cache misses
5251
Performance: 0% cache hit rate
5352

5453
Task Details:

crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots/builtin different cwd.snap

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd
54
---
65
> cd folder1 && vp run lint # cache miss in folder1
76
$ vp lint
@@ -28,7 +27,7 @@ Finished in <duration> on 2 files with 90 rules using <n> threads.
2827
Vite+ Task Runner • Execution Summary
2928
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3029

31-
Statistics: 1 tasks • 0 cache hits • 1 cache misses
30+
Statistics: 1 tasks • 0 cache hits • 1 cache misses
3231
Performance: 0% cache hit rate
3332

3433
Task Details:
@@ -61,7 +60,7 @@ Finished in <duration> on 2 files with 90 rules using <n> threads.
6160
Vite+ Task Runner • Execution Summary
6261
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6362

64-
Statistics: 1 tasks • 1 cache hits • 0 cache misses
63+
Statistics: 1 tasks • 1 cache hits • 0 cache misses
6564
Performance: 100% cache hit rate, <duration> saved in total
6665

6766
Task Details:
@@ -89,7 +88,7 @@ Finished in <duration> on 2 files with 90 rules using <n> threads.
8988
Vite+ Task Runner • Execution Summary
9089
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
9190

92-
Statistics: 1 tasks • 0 cache hits • 1 cache misses
91+
Statistics: 1 tasks • 0 cache hits • 1 cache misses
9392
Performance: 0% cache hit rate
9493

9594
Task Details:
@@ -115,7 +114,7 @@ Finished in <duration> on 2 files with 90 rules using <n> threads.
115114
Vite+ Task Runner • Execution Summary
116115
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
117116

118-
Statistics: 1 tasks • 1 cache hits • 0 cache misses
117+
Statistics: 1 tasks • 1 cache hits • 0 cache misses
119118
Performance: 100% cache hit rate, <duration> saved in total
120119

121120
Task Details:

crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit/snapshots/builtin command with non-zero exit does not show cache not updated.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-non-zero-exit
54
---
65
[1]> vp run lint -- -D no-debugger
76
$ vp lint -D no-debugger
@@ -21,7 +20,7 @@ Finished in <duration> on 1 file with 90 rules using <n> threads.
2120
Vite+ Task Runner • Execution Summary
2221
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2322
24-
Statistics: 1 tasks • 0 cache hits • 1 cache misses • 1 failed
23+
Statistics: 1 tasks • 0 cache hits • 1 cache misses • 1 failed
2524
Performance: 0% cache hit rate
2625
2726
Task Details:
@@ -47,7 +46,7 @@ Finished in <duration> on 1 file with 90 rules using <n> threads.
4746
Vite+ Task Runner • Execution Summary
4847
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4948
50-
Statistics: 1 tasks • 0 cache hits • 1 cache misses • 1 failed
49+
Statistics: 1 tasks • 0 cache hits • 1 cache misses • 1 failed
5150
Performance: 0% cache hit rate
5251
5352
Task Details:

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache disabled.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled
54
---
65
> vp run no-cache-task # cache miss
76
$ print-file test.txtcache disabled: no cache config
@@ -12,7 +11,7 @@ test content
1211
Vite+ Task RunnerExecution Summary
1312
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1413

15-
Statistics: 1 tasks0 cache hits0 cache misses1 cache disabled
14+
Statistics: 1 tasks0 cache hits0 cache misses1 cache disabled
1615
Performance: 0% cache hit rate
1716

1817
Task Details:
@@ -29,7 +28,7 @@ test content
2928
Vite+ Task RunnerExecution Summary
3029
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3130

32-
Statistics: 1 tasks0 cache hits0 cache misses1 cache disabled
31+
Statistics: 1 tasks0 cache hits0 cache misses1 cache disabled
3332
Performance: 0% cache hit rate
3433

3534
Task Details:

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots/task with cache enabled.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled
54
---
65
> vp run cached-task # cache miss
76
$ print-file test.txt
@@ -12,7 +11,7 @@ test content
1211
Vite+ Task RunnerExecution Summary
1312
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1413

15-
Statistics: 1 tasks0 cache hits1 cache misses
14+
Statistics: 1 tasks0 cache hits1 cache misses
1615
Performance: 0% cache hit rate
1716

1817
Task Details:
@@ -29,7 +28,7 @@ test content
2928
Vite+ Task RunnerExecution Summary
3029
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3130

32-
Statistics: 1 tasks1 cache hits0 cache misses
31+
Statistics: 1 tasks1 cache hits0 cache misses
3332
Performance: 100% cache hit rate, <duration> saved in total
3433

3534
Task Details:

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots/cache miss command change.snap

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change
54
---
65
> vp run task # cache miss
76
$ print foo
@@ -15,7 +14,7 @@ bar
1514
Vite+ Task RunnerExecution Summary
1615
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1716

18-
Statistics: 2 tasks0 cache hits2 cache misses
17+
Statistics: 2 tasks0 cache hits2 cache misses
1918
Performance: 0% cache hit rate
2019

2120
Task Details:
@@ -40,7 +39,7 @@ bar
4039
Vite+ Task RunnerExecution Summary
4140
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4241

43-
Statistics: 2 tasks1 cache hits1 cache misses
42+
Statistics: 2 tasks1 cache hits1 cache misses
4443
Performance: 50% cache hit rate, <duration> saved in total
4544

4645
Task Details:
@@ -62,7 +61,7 @@ bar
6261
Vite+ Task Runner • Execution Summary
6362
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6463

65-
Statistics: 1 tasks • 1 cache hits • 0 cache misses
64+
Statistics: 1 tasks • 1 cache hits • 0 cache misses
6665
Performance: 100% cache hit rate, <duration> saved in total
6766

6867
Task Details:

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons
54
---
65
> vp run test # cache miss
76
$ print-file test.txt
@@ -12,7 +11,7 @@ initial content
1211
Vite+ Task RunnerExecution Summary
1312
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1413

15-
Statistics: 1 tasks0 cache hits1 cache misses
14+
Statistics: 1 tasks0 cache hits1 cache misses
1615
Performance: 0% cache hit rate
1716

1817
Task Details:
@@ -35,7 +34,7 @@ initial content
3534
Vite+ Task RunnerExecution Summary
3635
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3736

38-
Statistics: 1 tasks0 cache hits1 cache misses
37+
Statistics: 1 tasks0 cache hits1 cache misses
3938
Performance: 0% cache hit rate
4039

4140
Task Details:

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env added.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons
54
---
65
> vp run test # cache miss
76
$ print-file test.txt
@@ -12,7 +11,7 @@ initial content
1211
Vite+ Task RunnerExecution Summary
1312
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1413

15-
Statistics: 1 tasks0 cache hits1 cache misses
14+
Statistics: 1 tasks0 cache hits1 cache misses
1615
Performance: 0% cache hit rate
1716

1817
Task Details:
@@ -29,7 +28,7 @@ initial content
2928
Vite+ Task RunnerExecution Summary
3029
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3130

32-
Statistics: 1 tasks0 cache hits1 cache misses
31+
Statistics: 1 tasks0 cache hits1 cache misses
3332
Performance: 0% cache hit rate
3433

3534
Task Details:

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/env removed.snap

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
4-
input_file: crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons
54
---
65
> cross-env MY_ENV=1 vp run test # cache miss
76
$ print-file test.txt
@@ -12,7 +11,7 @@ initial content
1211
Vite+ Task RunnerExecution Summary
1312
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1413

15-
Statistics: 1 tasks0 cache hits1 cache misses
14+
Statistics: 1 tasks0 cache hits1 cache misses
1615
Performance: 0% cache hit rate
1716

1817
Task Details:
@@ -29,7 +28,7 @@ initial content
2928
Vite+ Task RunnerExecution Summary
3029
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3130

32-
Statistics: 1 tasks0 cache hits1 cache misses
31+
Statistics: 1 tasks0 cache hits1 cache misses
3332
Performance: 0% cache hit rate
3433

3534
Task Details:

0 commit comments

Comments
 (0)