Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/commands/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
// Aborts with an error if this installation is not updatable.
assert_updatable()?;

// It's not currently possible to easily mock I/O with `trycmd`,
// but verifying that `execute` is not panicking, is good enough for now.
if env::var("SENTRY_INTEGRATION_TEST").is_ok() {
println!("Running in integration tests mode. Skipping execution.");
return Ok(());
}

let exe = env::current_exe()?;
let update = get_latest_sentrycli_release()
.with_context(|| "Error getting latest Sentry CLI version.")?;
Expand All @@ -37,13 +44,6 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {

println!("Latest release is {}", update.latest_version());

// It's not currently possible to easily mock I/O with `trycmd`,
// but verifying that `execute` is not panicking, is good enough for now.
if env::var("SENTRY_INTEGRATION_TEST").is_ok() {
println!("Running in integration tests mode. Skipping execution.");
return Ok(());
}

if update.is_latest_version() {
if matches.get_flag("force") {
println!("Forcing update");
Expand Down
1 change: 0 additions & 1 deletion tests/integration/_cases/update/update.trycmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
```
$ sentry-cli update
? success
Latest release is [..]
Running in integration tests mode. Skipping execution.

```