Skip to content

Commit b0f9e4d

Browse files
committed
test: allow cold downloads across snapshot cases
1 parent 6bcf7b7 commit b0f9e4d

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

‎crates/vp_cli_snapshots/tests/cli_snapshots/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ A step is a bare argv array or a table:
194194
# any other name resolves from the case env
195195
# (`PATH = "${workspace}/bin${PATH_SEPARATOR}${PATH}"`
196196
# is the shell's `PATH="$(pwd)/bin:$PATH"`)
197-
timeout = 120000, # ms, default 120s (includes cold package-manager downloads)
197+
timeout = 600000, # ms, default 10 minutes (includes cold package-manager downloads)
198198
snapshot = false, # omit the screen while the step succeeds
199199
# (failures always keep their output)
200200
continue-on-failure = true, # a failing step skips the rest of its line,

‎crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_bun/snapshots.toml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
name = "command_list_bun"
33
vp = "global"
44
skip-platforms = ["windows"]
5-
# The initial install also downloads Bun into the fresh case home.
65
steps = [
7-
{ argv = ["vp", "install"], comment = "should install packages first", timeout = 180000, continue-on-failure = true },
6+
{ argv = ["vp", "install"], comment = "should install packages first", continue-on-failure = true },
87
{ argv = ["vp", "pm", "list", "--help"], comment = "should show help", continue-on-failure = true },
98
{ argv = ["vp", "pm", "list"], comment = "should list installed packages", continue-on-failure = true },
109
]

‎crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_bun_with_workspace/snapshots.toml‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
name = "command_update_bun_with_workspace"
33
vp = "global"
44
skip-platforms = ["windows"]
5-
# Each case downloads Bun into a fresh home before the update commands.
65
steps = [
7-
{ argv = ["vp", "install", "--", "--silent"], comment = "should install packages first", timeout = 180000, continue-on-failure = true },
6+
{ argv = ["vp", "install", "--", "--silent"], comment = "should install packages first", continue-on-failure = true },
87
{ argv = ["vp", "update", "testnpm2", "--filter", "app", "--", "--silent"], comment = "should update package in packages/app" },
98
{ argv = ["vpt", "print-file", "packages/app/package.json"], continue-on-failure = true },
109
]
@@ -19,7 +18,7 @@ steps = [
1918
{ argv = ["vpt", "write-file", "packages/app/package.json", '{"name":"app","version":"1.0.0","dependencies":{"is-number":"6.0.0"}}'], snapshot = false },
2019
{ argv = ["vpt", "mkdir", "packages/utils"], snapshot = false },
2120
{ argv = ["vpt", "write-file", "packages/utils/package.json", '{"name":"utils","version":"1.0.0","dependencies":{"is-number":"6.0.0"}}'], snapshot = false },
22-
{ argv = ["vp", "install", "--ignore-scripts"], snapshot = false, timeout = 180000 },
21+
{ argv = ["vp", "install", "--ignore-scripts"], snapshot = false },
2322
{ argv = ["vp", "update", "--recursive", "is-number@7.0.0", "--", "--ignore-scripts"], cwd = "packages/app", comment = "Bun 1.4 updates the root and both workspaces even when invoked from a child" },
2423
["vpt", "print-file", "package.json", "packages/app/package.json", "packages/utils/package.json"],
2524
["vpt", "print-file", "bun.lock"],
@@ -35,7 +34,7 @@ steps = [
3534
{ argv = ["vpt", "write-file", "packages/app/package.json", '{"name":"app","version":"1.0.0","dependencies":{"is-number":"6.0.0"}}'], snapshot = false },
3635
{ argv = ["vpt", "mkdir", "packages/utils"], snapshot = false },
3736
{ argv = ["vpt", "write-file", "packages/utils/package.json", '{"name":"utils","version":"1.0.0","dependencies":{"is-number":"6.0.0"}}'], snapshot = false },
38-
{ argv = ["vp", "install", "--ignore-scripts"], snapshot = false, timeout = 180000 },
37+
{ argv = ["vp", "install", "--ignore-scripts"], snapshot = false },
3938
{ argv = ["vp", "update", "--recursive", "--filter", "utils", "is-number@7.0.0", "--", "--ignore-scripts"], cwd = "packages/app", comment = "an explicit filter limits recursive updates to the selected workspace" },
4039
["vpt", "print-file", "package.json", "packages/app/package.json", "packages/utils/package.json"],
4140
["vpt", "print-file", "bun.lock"],

‎crates/vp_cli_snapshots/tests/cli_snapshots/main.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ use flavor::{Flavor, FlavorRuntime};
3939
use redact::redact_output;
4040
use vt_pty_terminal_test::{CommandBuilder, ScreenSize, TestTerminal};
4141

42-
/// Cases have isolated package-manager installs. Downloading a native Bun or
43-
/// pnpm binary can exceed a minute on CI, before the command itself starts.
44-
/// Keep the same allowance as registry-backed installs on every platform.
42+
/// Cases have isolated package-manager installs. CI can take several minutes
43+
/// to download a native Bun or pnpm binary before the command itself starts.
44+
/// Allow the same ten-minute budget as the CLI's large-file downloads instead
45+
/// of killing a transfer that is still making progress after two minutes.
4546
/// Individual steps override this via `timeout` (ms).
46-
const STEP_TIMEOUT: Duration = Duration::from_secs(120);
47+
const STEP_TIMEOUT: Duration = Duration::from_secs(600);
4748

4849
/// Screen size for the PTY terminal. Large enough to avoid line wrapping.
4950
const SCREEN_SIZE: ScreenSize = ScreenSize { rows: 500, cols: 500 };

0 commit comments

Comments
 (0)