Skip to content

Commit b813aa8

Browse files
authored
[3/n] make tufaceous assemble exit with non-zero on failure
Realized while writing tests here that we exit on failure with a zero exit code. That's okay for cleanup but not for the assembly itself. Reviewers: iliana Reviewed By: iliana Pull Request: #19
1 parent ad5e0d3 commit b813aa8

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

bin/tests/integration-tests/command_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ fn test_assemble_duplicate_artifact() -> Result<()> {
273273
"invalid-manifests/duplicate-artifact.toml",
274274
]);
275275
cmd.arg(&archive_path);
276-
// TODO: this should be failure, not success!
277-
cmd.assert().success().stderr(predicate::str::contains(
276+
cmd.assert().failure().stderr(predicate::str::contains(
278277
"a target named gimlet_sp-fake-gimlet-sp-1.0.0.tar.gz \
279278
already exists in the repository",
280279
));

lib/src/assemble/build.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,16 @@ impl OmicronRepoAssembler {
7979
"artifacts assembled and archived to `{}`",
8080
self.output_path
8181
);
82+
Ok(())
8283
}
8384
Err(error) => {
84-
slog::error!(self.log, "assembly failed: {error:?}");
85-
slog::info!(
85+
slog::error!(
8686
self.log,
87-
"failing build directory preserved: `{build_dir}`"
87+
"assembly failed, failing build directory preserved: `{build_dir}`"
8888
);
89+
Err(error)
8990
}
9091
}
91-
92-
Ok(())
9392
}
9493

9594
async fn build_impl(&self, build_dir: &Utf8Path) -> Result<()> {

0 commit comments

Comments
 (0)