summaryrefslogtreecommitdiffstats
path: root/src/pipeline/publish.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pipeline/publish.rs')
-rw-r--r--src/pipeline/publish.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pipeline/publish.rs b/src/pipeline/publish.rs
index 4f21e72..d70ba8d 100644
--- a/src/pipeline/publish.rs
+++ b/src/pipeline/publish.rs
@@ -117,7 +117,9 @@ pub fn publish(ctx: &Ctx) -> Result<i64> {
// Fault injection so I4 can be tested for real: die between the tmp write
// and the rename, and the old index must still be what consumers get.
- if ctx.cfg.publish_fault.as_deref() == Some("before-rename") {
+ // Compiled out of a production build (ยง6 M-9).
+ #[cfg(feature = "test-support")]
+ if ctx.cfg.hooks.publish_fault.as_deref() == Some("before-rename") {
return Err(Error::other("injected fault: before-rename"));
}
@@ -148,7 +150,8 @@ pub fn publish(ctx: &Ctx) -> Result<i64> {
"unblocked_builds": unblocked,
}),
)?;
- if ctx.cfg.publish_fault.as_deref() == Some("after-rename") {
+ #[cfg(feature = "test-support")]
+ if ctx.cfg.hooks.publish_fault.as_deref() == Some("after-rename") {
return Err(Error::other("injected fault: after-rename"));
}
Ok(release_id)