Skip to content

Commit b7769b9

Browse files
committed
test: verify direct vp pack/vp build are not cached
1 parent b8706c9 commit b7769b9

File tree

6 files changed

+31
-1
lines changed

6 files changed

+31
-1
lines changed

packages/cli/snap-tests/command-pack-monorepo/snap.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ vp run: cache hit, <variable>ms saved.
1010
~/packages/hello$ vp pack ◉ cache hit, replaying
1111
vp run: cache hit, <variable>ms saved.
1212

13+
> cd packages/hello && vp pack 2>&1 # direct vp pack should not be cached
14+
> cd packages/hello && vp pack 2>&1 | grep -c 'cache' || echo 'no cache' # direct vp pack has no cache
15+
0
16+
no cache
17+
1318
> echo 'export function hello() { console.log("changed"); }' > packages/hello/src/hello.ts
1419
> vp run hello#build 2>&1 | grep 'cache miss' # should miss cache after source change
1520
~/packages/hello$ vp pack ○ cache miss: 'packages/hello/src/hello.ts' modified, executing

packages/cli/snap-tests/command-pack-monorepo/steps.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
"ls packages/hello/dist # should have the library",
88
"vp run hello#build 2>&1 | grep 'cache hit' # should hit cache",
99
"cd packages/hello && vp run build 2>&1 | grep 'cache hit' # should hit cache in sub dir",
10+
{
11+
"command": "cd packages/hello && vp pack 2>&1 # direct vp pack should not be cached",
12+
"ignoreOutput": true
13+
},
14+
"cd packages/hello && vp pack 2>&1 | grep -c 'cache' || echo 'no cache' # direct vp pack has no cache",
1015
"echo 'export function hello() { console.log(\"changed\"); }' > packages/hello/src/hello.ts",
1116
"vp run hello#build 2>&1 | grep 'cache miss' # should miss cache after source change",
1217
{

packages/cli/snap-tests/vp-build-cache-monorepo/snap.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ vp run: cache hit, <variable>ms saved.
1111
~/packages/app$ vp build ◉ cache hit, replaying
1212
vp run: cache hit, <variable>ms saved.
1313

14+
> cd packages/app && vp build 2>&1 # direct vp build should not be cached
15+
> cd packages/app && vp build 2>&1 | grep -c 'cache' || echo 'no cache' # direct vp build has no cache
16+
0
17+
no cache
18+
1419
> echo '<html><body><script type="module">console.log("changed");</script></body></html>' > packages/app/index.html
1520
> vp run app#build 2>&1 | grep 'cache miss' # should miss cache after source change
1621
~/packages/app$ vp build ○ cache miss: 'packages/app/index.html' modified, executing

packages/cli/snap-tests/vp-build-cache-monorepo/steps.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
"ls packages/app/dist # should have the build output",
88
"vp run app#build 2>&1 | grep 'cache hit' # should hit cache",
99
"cd packages/app && vp run build 2>&1 | grep 'cache hit' # should hit cache in sub dir",
10+
{
11+
"command": "cd packages/app && vp build 2>&1 # direct vp build should not be cached",
12+
"ignoreOutput": true
13+
},
14+
"cd packages/app && vp build 2>&1 | grep -c 'cache' || echo 'no cache' # direct vp build has no cache",
1015
"echo '<html><body><script type=\"module\">console.log(\"changed\");</script></body></html>' > packages/app/index.html",
1116
"vp run app#build 2>&1 | grep 'cache miss' # should miss cache after source change",
1217
{

packages/cli/snap-tests/vp-build-cache/snap.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
> vp run build 2>&1 | grep 'cache hit' # should hit cache
33
$ vp build ◉ cache hit, replaying
44
vp run: cache hit, <variable>ms saved.
5+
6+
> vp build 2>&1 # direct vp build should not be cached
7+
> vp build 2>&1 | grep -c 'cache' || echo 'no cache' # direct vp build has no cache
8+
0
9+
no cache

packages/cli/snap-tests/vp-build-cache/steps.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"command": "vp run build # first build",
55
"ignoreOutput": true
66
},
7-
"vp run build 2>&1 | grep 'cache hit' # should hit cache"
7+
"vp run build 2>&1 | grep 'cache hit' # should hit cache",
8+
{
9+
"command": "vp build 2>&1 # direct vp build should not be cached",
10+
"ignoreOutput": true
11+
},
12+
"vp build 2>&1 | grep -c 'cache' || echo 'no cache' # direct vp build has no cache"
813
]
914
}

0 commit comments

Comments
 (0)