Skip to content

Commit 6a0899c

Browse files
branchseerclaude
andcommitted
test: enable compact plan snapshots for structure-only test cases
Enable compact = true for nested-tasks, pnpm-workspace-packages-optional, and vpr-shorthand fixtures since they only verify graph structure, not execution details like cache metadata or env vars. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 04c782c commit 6a0899c

6 files changed

Lines changed: 23 additions & 193 deletions

File tree

crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks/snapshots.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
[[plan]]
44
name = "nested vp run"
55
args = ["run", "script2"]
6+
compact = true
Lines changed: 8 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,15 @@
11
---
22
source: crates/vite_task_plan/tests/plan_snapshots/main.rs
3-
expression: "&plan_json"
3+
expression: "&compact_plan"
44
input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/nested-tasks
55
---
6-
[
7-
{
8-
"key": [
9-
"<workspace>/",
10-
"script2"
6+
{
7+
"#script2": {
8+
"items": [
9+
{
10+
"#script1": []
11+
}
1112
],
12-
"node": {
13-
"task_display": {
14-
"package_name": "",
15-
"task_name": "script2",
16-
"package_path": "<workspace>/"
17-
},
18-
"items": [
19-
{
20-
"execution_item_display": {
21-
"task_display": {
22-
"package_name": "",
23-
"task_name": "script2",
24-
"package_path": "<workspace>/"
25-
},
26-
"command": "vp run script1",
27-
"and_item_index": null,
28-
"cwd": "<workspace>/"
29-
},
30-
"kind": {
31-
"Expanded": [
32-
{
33-
"key": [
34-
"<workspace>/",
35-
"script1"
36-
],
37-
"node": {
38-
"task_display": {
39-
"package_name": "",
40-
"task_name": "script1",
41-
"package_path": "<workspace>/"
42-
},
43-
"items": [
44-
{
45-
"execution_item_display": {
46-
"task_display": {
47-
"package_name": "",
48-
"task_name": "script1",
49-
"package_path": "<workspace>/"
50-
},
51-
"command": "echo hello",
52-
"and_item_index": null,
53-
"cwd": "<workspace>/"
54-
},
55-
"kind": {
56-
"Leaf": {
57-
"InProcess": {
58-
"kind": {
59-
"Echo": {
60-
"strings": [
61-
"hello"
62-
],
63-
"trailing_newline": true
64-
}
65-
}
66-
}
67-
}
68-
}
69-
}
70-
]
71-
},
72-
"neighbors": []
73-
}
74-
]
75-
}
76-
}
77-
]
78-
},
7913
"neighbors": []
8014
}
81-
]
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[[plan]]
22
name = "allow `packages` in pnpm-workspace.yaml to be optional"
33
args = ["run", "hello"]
4+
compact = true
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,8 @@
11
---
22
source: crates/vite_task_plan/tests/plan_snapshots/main.rs
3-
expression: "&plan_json"
3+
expression: "&compact_plan"
44
input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/pnpm-workspace-packages-optional
55
---
6-
[
7-
{
8-
"key": [
9-
"<workspace>/",
10-
"hello"
11-
],
12-
"node": {
13-
"task_display": {
14-
"package_name": "additional-envs",
15-
"task_name": "hello",
16-
"package_path": "<workspace>/"
17-
},
18-
"items": [
19-
{
20-
"execution_item_display": {
21-
"task_display": {
22-
"package_name": "additional-envs",
23-
"task_name": "hello",
24-
"package_path": "<workspace>/"
25-
},
26-
"command": "echo hello",
27-
"and_item_index": null,
28-
"cwd": "<workspace>/"
29-
},
30-
"kind": {
31-
"Leaf": {
32-
"InProcess": {
33-
"kind": {
34-
"Echo": {
35-
"strings": [
36-
"hello"
37-
],
38-
"trailing_newline": true
39-
}
40-
}
41-
}
42-
}
43-
}
44-
}
45-
]
46-
},
47-
"neighbors": []
48-
}
49-
]
6+
{
7+
"#hello": []
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[[plan]]
22
name = "vpr expands to vp run"
33
args = ["run", "all"]
4+
compact = true
Lines changed: 8 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,15 @@
11
---
22
source: crates/vite_task_plan/tests/plan_snapshots/main.rs
3-
expression: "&plan_json"
3+
expression: "&compact_plan"
44
input_file: crates/vite_task_plan/tests/plan_snapshots/fixtures/vpr-shorthand
55
---
6-
[
7-
{
8-
"key": [
9-
"<workspace>/",
10-
"all"
6+
{
7+
"#all": {
8+
"items": [
9+
{
10+
"#build": []
11+
}
1112
],
12-
"node": {
13-
"task_display": {
14-
"package_name": "",
15-
"task_name": "all",
16-
"package_path": "<workspace>/"
17-
},
18-
"items": [
19-
{
20-
"execution_item_display": {
21-
"task_display": {
22-
"package_name": "",
23-
"task_name": "all",
24-
"package_path": "<workspace>/"
25-
},
26-
"command": "vpr build",
27-
"and_item_index": null,
28-
"cwd": "<workspace>/"
29-
},
30-
"kind": {
31-
"Expanded": [
32-
{
33-
"key": [
34-
"<workspace>/",
35-
"build"
36-
],
37-
"node": {
38-
"task_display": {
39-
"package_name": "",
40-
"task_name": "build",
41-
"package_path": "<workspace>/"
42-
},
43-
"items": [
44-
{
45-
"execution_item_display": {
46-
"task_display": {
47-
"package_name": "",
48-
"task_name": "build",
49-
"package_path": "<workspace>/"
50-
},
51-
"command": "echo building",
52-
"and_item_index": null,
53-
"cwd": "<workspace>/"
54-
},
55-
"kind": {
56-
"Leaf": {
57-
"InProcess": {
58-
"kind": {
59-
"Echo": {
60-
"strings": [
61-
"building"
62-
],
63-
"trailing_newline": true
64-
}
65-
}
66-
}
67-
}
68-
}
69-
}
70-
]
71-
},
72-
"neighbors": []
73-
}
74-
]
75-
}
76-
}
77-
]
78-
},
7913
"neighbors": []
8014
}
81-
]
15+
}

0 commit comments

Comments
 (0)