diff --git a/crates/vt_bin/tests/e2e_snapshots/fixtures/dry_run_json/snapshots.toml b/crates/vt_bin/tests/e2e_snapshots/fixtures/dry_run_json/snapshots.toml index 465d5fcec..19a5b0bab 100644 --- a/crates/vt_bin/tests/e2e_snapshots/fixtures/dry_run_json/snapshots.toml +++ b/crates/vt_bin/tests/e2e_snapshots/fixtures/dry_run_json/snapshots.toml @@ -285,6 +285,23 @@ steps = [ "remote-cache-server", "start", ], + { argv = [ + "remote-cache-server", + "run", + "--github-actions", + "vt", + "run", + "emit", + ], envs = [ + [ + "VP_REMOTE_CACHE", + "read-write", + ], + [ + "VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS", + "1", + ], + ], comment = "`emit` runs first, on its own, so its upload doesn't overlap `after-emit`'s fetch." }, { argv = [ "remote-cache-server", "run", @@ -302,6 +319,23 @@ steps = [ "1", ], ] }, + { argv = [ + "remote-cache-server", + "run", + "--github-actions", + "vt", + "run", + "build", + ], envs = [ + [ + "VP_REMOTE_CACHE", + "read-write", + ], + [ + "VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS", + "1", + ], + ], comment = "`build` runs first, on its own, so its upload doesn't overlap `after-build`'s fetch." }, { argv = [ "remote-cache-server", "run", @@ -318,7 +352,7 @@ steps = [ "VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS", "1", ], - ], comment = "`after-build` runs the same command as `after-emit`, so that step hits the entry the first run stored." }, + ], comment = "`after-build` runs the same command as `after-emit`, so that step hits the entry `after-emit`'s run stored, and nothing is fetched." }, [ "vt", "cache", diff --git a/crates/vt_bin/tests/e2e_snapshots/fixtures/dry_run_json/snapshots/unknown_after_remote_hit.md b/crates/vt_bin/tests/e2e_snapshots/fixtures/dry_run_json/snapshots/unknown_after_remote_hit.md index fac7c4d20..c99dfdd2e 100644 --- a/crates/vt_bin/tests/e2e_snapshots/fixtures/dry_run_json/snapshots/unknown_after_remote_hit.md +++ b/crates/vt_bin/tests/e2e_snapshots/fixtures/dry_run_json/snapshots/unknown_after_remote_hit.md @@ -7,28 +7,50 @@ As after a local hit, the steps after a remote hit are `unknown` only if it rest ``` ``` -## `VP_REMOTE_CACHE=read-write VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS=1 remote-cache-server run --github-actions vt run after-emit` +## `VP_REMOTE_CACHE=read-write VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS=1 remote-cache-server run --github-actions vt run emit` + +`emit` runs first, on its own, so its upload doesn't overlap `after-emit`'s fetch. ``` $ vtt write-file dist/out.txt built +[remote-cache] POST /fetch 404 +[remote-cache] POST /store 200 +``` + +## `VP_REMOTE_CACHE=read-write VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS=1 remote-cache-server run --github-actions vt run after-emit` + +``` +$ vtt write-file dist/out.txt built ◉ cache hit, replaying + $ vtt print checked checked --- -vt run: 0/2 cache hit (0%), 2/2 successful. (Run `vt run --last-details` for full details) -[remote-cache] POST /fetch 404 +vt run: 1/2 cache hit (50%), 2/2 successful. (Run `vt run --last-details` for full details) [remote-cache] POST /fetch 404 [remote-cache] POST /store 200 +``` + +## `VP_REMOTE_CACHE=read-write VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS=1 remote-cache-server run --github-actions vt run build` + +`build` runs first, on its own, so its upload doesn't overlap `after-build`'s fetch. + +``` +$ vtt print-file a.txt b.txt +a +b + +[remote-cache] POST /fetch 404 [remote-cache] POST /store 200 ``` ## `VP_REMOTE_CACHE=read-write VP_RUN_INTERNAL_HIDE_PENDING_UPLOADS=1 remote-cache-server run --github-actions vt run after-build` -`after-build` runs the same command as `after-emit`, so that step hits the entry the first run stored. +`after-build` runs the same command as `after-emit`, so that step hits the entry `after-emit`'s run stored, and nothing is fetched. ``` -$ vtt print-file a.txt b.txt +$ vtt print-file a.txt b.txt ◉ cache hit, replaying a b @@ -36,9 +58,7 @@ $ vtt print checked ◉ cache hit, replaying checked --- -vt run: 1/2 cache hit (50%), 2/2 successful. (Run `vt run --last-details` for full details) -[remote-cache] POST /fetch 404 -[remote-cache] POST /store 200 +vt run: 2/2 cache hit (100%), 2/2 successful. (Run `vt run --last-details` for full details) ``` ## `vt cache clean`