Skip to content

Commit 0bf3cde

Browse files
branchseerfengmk2
authored andcommitted
add case task-no-trailing-newline
1 parent e81cb21 commit 0bf3cde

30 files changed

Lines changed: 131 additions & 0 deletions

File tree

crates/vite_task/src/schedule.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ impl ExecutionPlan {
167167

168168
// Execute or replay the task
169169
let exit_status = execute_or_replay.await?;
170+
171+
// FIXME: Print a new line to separate the tasks output, need a better solution
172+
println!();
170173
Ok(ExecutionStatus {
171174
execution_id,
172175
pre_execution_status,

packages/cli/snap-tests/associate-existing-cache/snap.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$ echo hello
33
hello
44

5+
56
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
Vite+ Task Runner • Execution Summary
78
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -19,6 +20,7 @@ Task Details:
1920
$ echo hello (✓ cache hit, replaying)
2021
hello
2122

23+
2224
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2325
Vite+ Task Runner • Execution Summary
2426
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -37,6 +39,7 @@ Task Details:
3739
$ echo world (✗ cache miss: command changed, executing)
3840
world
3941

42+
4043
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4144
Vite+ Task Runner • Execution Summary
4245
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

packages/cli/snap-tests/builtin-different-cwd/snap.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
Found 0 warnings and 0 errors.
33
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.
44

5+
56
> cd folder2 && vite lint # should create different cache even though the package is the same
67
Found 0 warnings and 0 errors.
78
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.
89

10+
911
> echo 'console.log(1);' > folder2/a.js
1012
> cd folder1 && vite lint
1113
✓ cache hit, replaying
1214
Found 0 warnings and 0 errors.
1315
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.
1416

17+
1518
> cd folder2 && vite lint
1619
✗ cache miss: content of input 'folder2/a.js' changed, executing
1720
Found 0 warnings and 0 errors.
1821
Finished in <variable>ms on 1 file with <variable> rules using <variable> threads.
22+

packages/cli/snap-tests/cache-clean/snap.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$ echo hello
33
hello
44

5+
56
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
Vite+ Task Runner • Execution Summary
78
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -19,6 +20,7 @@ Task Details:
1920
$ echo hello (✓ cache hit, replaying)
2021
hello
2122

23+
2224
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2325
Vite+ Task Runner • Execution Summary
2426
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -37,6 +39,7 @@ Task Details:
3739
$ echo hello
3840
hello
3941

42+
4043
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4144
Vite+ Task Runner • Execution Summary
4245
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -55,6 +58,7 @@ Task Details:
5558
$ echo hello
5659
hello
5760

61+
5862
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5963
Vite+ Task Runner • Execution Summary
6064
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

packages/cli/snap-tests/cache-miss-command-change/snap.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
> vite run hello # create caches for 'echo foo' and 'echo bar'
22
$ echo foo
33
foo
4+
45
$ echo bar
56
bar
67

8+
79
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
810
Vite+ Task Runner • Execution Summary
911
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -24,9 +26,11 @@ Task Details:
2426
> vite run hello # should report cache miss of the first subcommand, and hit cache of the second subcommand
2527
$ echo baz (✗ cache miss: command changed, executing)
2628
baz
29+
2730
$ echo bar (✓ cache hit, replaying)
2831
bar
2932

33+
3034
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3135
Vite+ Task Runner • Execution Summary
3236
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -48,6 +52,7 @@ Task Details:
4852
$ echo bar (✓ cache hit, replaying)
4953
bar
5054

55+
5156
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5257
Vite+ Task Runner • Execution Summary
5358
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

packages/cli/snap-tests/change-passthrough-env-config/snap.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$ node -p process.env.MY_ENV
33
1
44

5+
56
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
Vite+ Task Runner • Execution Summary
78
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -19,6 +20,7 @@ Task Details:
1920
$ node -p process.env.MY_ENV (✓ cache hit, replaying)
2021
1
2122

23+
2224
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2325
Vite+ Task Runner • Execution Summary
2426
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -37,6 +39,7 @@ Task Details:
3739
$ node -p process.env.MY_ENV (✗ cache miss: envs changed, executing)
3840
2
3941

42+
4043
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4144
Vite+ Task Runner • Execution Summary
4245
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

packages/cli/snap-tests/check-oxlint-env/snap.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$ node check.js
33
OXLINT_TSGOLINT_PATH=/path/to/oxlint_tsgolint1
44

5+
56
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
67
Vite+ Task Runner • Execution Summary
78
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -20,6 +21,8 @@ Task Details:
2021
$ node check.js
2122
OXLINT_TSGOLINT_PATH=/path/to/oxlint_tsgolint2
2223

24+
25+
2326
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2427
Vite+ Task Runner • Execution Summary
2528
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

packages/cli/snap-tests/command-doc/snap.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
build complete in <variable>ms.
66

7+
78
- building client + server bundles...
89
✓ building client + server bundles...
910
- rendering pages...
@@ -16,6 +17,7 @@ build complete in <variable>ms.
1617

1718
build complete in <variable>ms.
1819

20+
1921
- building client + server bundles...
2022
✓ building client + server bundles...
2123
- rendering pages...

packages/cli/snap-tests/command-helper/snap.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Options:
4949
-h, --help Display this message
5050
-v, --version Display version number
5151

52+
5253
> vite fmt -h # fmt help message
5354
Usage: [--check | --list-different] [PATH]...
5455

@@ -69,6 +70,7 @@ Available options:
6970
-V, --version Prints version information
7071

7172

73+
7274
> vite lint -h # lint help message
7375
Usage: [-c=<./.oxlintrc.json>] [PATH]...
7476

@@ -165,6 +167,7 @@ Available options:
165167
-V, --version Prints version information
166168

167169

170+
168171
> vite build -h # build help message
169172
vite/<semver>
170173

@@ -194,6 +197,7 @@ Options:
194197
-m, --mode <mode> [string] set env mode
195198
-h, --help Display this message
196199

200+
197201
> vite test -h # test help message
198202
vitest/<semver>
199203
WARN: no options were found for your subcommands so we printed the whole output
@@ -284,3 +288,4 @@ Options:
284288
--standalone Start Vitest without running tests. File filters will be ignored, tests will be running only on change (default: false)
285289
--mergeReports [path] Path to a blob reports directory. If this options is used, Vitest won't run any tests, it will only report previously recorded tests
286290
-h, --help Display this message
291+

packages/cli/snap-tests/command-install-shortcut/snap.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies:
88

99
Done in <variable>ms using pnpm v<semver>
1010

11+
1112
> vite i # install shortcut hit cache
1213
✓ cache hit, replaying
1314
Packages: +<variable>
@@ -19,6 +20,7 @@ dependencies:
1920

2021
Done in <variable>ms using pnpm v<semver>
2122

23+
2224
> vite install # install command still hit cache
2325
✓ cache hit, replaying
2426
Packages: +<variable>
@@ -29,3 +31,4 @@ dependencies:
2931
+ tslib <semver>
3032

3133
Done in <variable>ms using pnpm v<semver>
34+

0 commit comments

Comments
 (0)