Dashboard › cli › Distillation
c5d7e840-1079-4e46-865e-6032bf390426["lore_tm_v1_HJpSBh9NWa1Tr3AdVhHlL6qGtJMiYuHAJwHO8n4z6Jw","lore_tm_v1_201v6kGCt_-akp7S63VG3cUP4Wm6BQesE1UGsamxtTs"]
Date: Sep 9, 2026
packages/cli/test/commands/cli/upgrade.test.ts use fakeChildProcess(exitCode), which creates a node:events EventEmitter and emits "close" with the specified exit code on the next microtask.sentry cli upgrade — curl full upgrade path (child_process.spawn spy) suite redirects curl installation to join(TEST_TMP_DIR, "upgrade-spawn-bin"), uses sentry.exe on Windows or sentry elsewhere, records spawned { cmd, args }, and makes mocked processes exit with code 0.mockBinaryDownloadWithVersion(version) serves GitHub releases/latest as { tag_name: version } and all binary requests as gzip-compressed ELF magic bytes [0x7f, 0x45, 0x4c, 0x46]."Checking for updates", "Downloading 99.99.99", "Upgraded to", and "99.99.99". It requires the downloaded binary to run setup with arguments containing cli, setup, --quiet, --method, curl, --install, and --ensure-auth-scopes.--ensure-auth-scopes, preventing interactive authentication.--no-agent-skills by default and forward it to setup only when the upgrade command receives --no-agent-skills.execPath="/usr/bin/node" and argv=["/usr/bin/node", "/npm/global/node_modules/sentry/dist/bin.cjs"] must execute setup through /npm/global/node_modules/sentry/dist/bin.cjs and include --ensure-auth-scopes./opt/homebrew/Cellar/sentry/old/bin/sentry locates the new sentry binary through PATH, executes that binary for setup, and omits --ensure-auth-scopes.1 must be reported as "Setup failed with exit code 1"."test-token") → /manifests/nightly → /blobs/sha256:abc123 → HTTP 307 redirect to https://blob.example.com/file.gz → gzip download. The manifest version is "0.99.0-dev.1234567890" and its platform filename is sentry-linux-x64.gz, sentry-windows-x64.exe.gz, or sentry-darwin-arm64.gz.sentry cli upgrade --method curl nightly must fetch both ghcr.io/token and /manifests/nightly.--force bypasses the normal same-version "Already up to date" short circuit: when the target equals CLI_VERSION, the command must still display Downloading ${CLI_VERSION}, "Upgraded to", and CLI_VERSION."test-token", version "0.99.0-dev.1234567890", digest "sha256:abc456", and a 307 redirect to https://blob.example.com/nightly.gz; platform filenames are sentry-linux-x64.gz, sentry-windows-x64.exe.gz, or sentry-darwin-arm64.gz.setReleaseChannel("nightly"), running sentry cli upgrade --method npm nightly must output "Nightly builds are only available as standalone binaries.", "Migrating to standalone installation...", and "Upgraded to". It must also warn that "npm-installed sentry may still appear earlier in PATH" and recommend npm uninstall -g sentry.isEbusyError() returns true only for an Error whose code is "EBUSY"; it returns false for "ENOENT", "EACCES", non-Error values ("EBUSY", null, undefined, 42), and an Error without a code.resolveUpgradeInstallDir() keeps non-legacy install directories unchanged. For legacy ~/.sentry/bin, it relocates to ~/.local/bin only when that XDG directory is on PATH; it keeps the legacy directory when the XDG directory is absent from PATH or PATH is undefined.resolveUpgradeInstallDir() treats a differently cased legacy directory as equivalent on Windows and macOS, allowing relocation to ~/.local/bin; on case-sensitive platforms it preserves the differently cased path.packages/cli/test/lib/version-check.test.ts. Tests at lines 197–215 require notification label "New nightly available:" on channel "nightly" and "Update available:" on channel "stable", with the stable notification explicitly excluding "New nightly available:".packages/cli/test/lib/version-check.test.ts preserves and restores globalThis.fetch around background-check tests, mocks background GitHub API requests to avoid unexpected-fetch warnings, permits background network failure without throwing, and includes an assertion that infoBefore.latestVersion equals "1.0.0".