Skip to content

Commit

Permalink
Improve CI debugability
Browse files Browse the repository at this point in the history
The call count assertion is binary; the failure explanation could be
varied
  • Loading branch information
rbtcollins committed May 31, 2023
1 parent 0fc594d commit 9092cb8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion download/tests/read-proxy-env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ async fn socks_proxy_request() {

if let Err(e) = res {
let s = e.source().unwrap();
assert!(
s.to_string().contains("socks connect error"),
"Expected socks connect error, got: {}",
s.to_string()
);
assert_eq!(CALL_COUNT.load(Ordering::SeqCst), 1);
assert!(s.to_string().contains("socks connect error"));
} else {
panic!("Socks proxy was ignored")
}
Expand Down
2 changes: 1 addition & 1 deletion src/bin/rustup-init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async fn run_rustup_inner() -> Result<utils::ExitCode> {
// name. Browsers rename duplicates to
// e.g. rustup-setup(2), and this allows all variations
// to work.
setup_mode::main()
setup_mode::main().await
}
Some(n) if n.starts_with("rustup-gc-") => {
// This is the final uninstallation stage on windows where
Expand Down
4 changes: 2 additions & 2 deletions src/cli/setup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
};

#[cfg_attr(feature = "otel", tracing::instrument)]
pub fn main() -> Result<utils::ExitCode> {
pub async fn main() -> Result<utils::ExitCode> {
let args: Vec<_> = process().args().collect();
let arg1 = args.get(1).map(|a| &**a);

Expand Down Expand Up @@ -157,5 +157,5 @@ pub fn main() -> Result<utils::ExitCode> {
warn!("{}", common::WARN_COMPLETE_PROFILE);
}

utils::run_future(self_update::install(no_prompt, verbose, quiet, opts))
self_update::install(no_prompt, verbose, quiet, opts).await
}

0 comments on commit 9092cb8

Please sign in to comment.