Skip to content

Commit 3d2f345

Browse files
committed
SelfTest: tell the user when running the self tests
Otherwise, if something happens to the self test, users may think the previous output is what is hanging (usually "INFO Step: Remove directory `/nix/temp-install-dir`") instead of the self test.
1 parent 1987243 commit 3d2f345

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/self_test.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ impl Shell {
7474
}
7575
}
7676

77-
#[tracing::instrument(skip_all)]
77+
#[tracing::instrument(level = "debug", skip_all)]
7878
pub async fn self_test(&self) -> Result<(), SelfTestError> {
7979
let executable = self.executable();
80+
81+
tracing::info!("Running self test for shell {executable}");
82+
8083
let mut command = match &self {
8184
// On Mac, `bash -ic nix` won't work, but `bash -lc nix` will.
8285
Shell::Sh | Shell::Bash => {
@@ -146,10 +149,12 @@ impl Shell {
146149
}
147150
}
148151

149-
#[tracing::instrument(skip_all)]
152+
#[tracing::instrument(level = "debug", skip_all)]
150153
pub async fn self_test() -> Result<(), Vec<SelfTestError>> {
151154
let shells = Shell::discover();
152155

156+
tracing::debug!(?shells, "Discovered shells to self test");
157+
153158
let mut failures = vec![];
154159

155160
for shell in shells {

0 commit comments

Comments
 (0)