Skip to content

Commit 77f3521

Browse files
committed
Update predict_name tests for digest-based backend names
The backend name now carries a SHA-256 digest suffix, so the three platform predict_name tests that pinned the exact/ending name string no longer hold. Assert the readable body via starts_with/contains instead. These were missed earlier because the local run filtered the platform suite too narrowly; CI aborted on the first panic.
1 parent baddbdc commit 77f3521

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

crates/trusted-server-adapter-fastly/src/platform.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,9 @@ mod tests {
733733
.predict_name(&spec)
734734
.expect("should compute backend name for valid spec");
735735

736-
assert_eq!(
737-
name, "backend_https_origin_example_com_443_fb15000_bb15000",
738-
"should match BackendConfig naming convention"
736+
assert!(
737+
name.starts_with("backend_https_origin_example_com_443_fb15000_bb15000_"),
738+
"should match BackendConfig naming convention, got {name}"
739739
);
740740
}
741741

@@ -757,9 +757,11 @@ mod tests {
757757
.predict_name(&spec)
758758
.expect("should compute backend name for host header override");
759759

760-
assert_eq!(
761-
name, "backend_https_origin_example_com_443_oh_www_example_com_fb15000_bb15000",
762-
"should match BackendConfig naming convention with host header override"
760+
assert!(
761+
name.starts_with(
762+
"backend_https_origin_example_com_443_oh_www_example_com_fb15000_bb15000_"
763+
),
764+
"should match BackendConfig naming convention with host header override, got {name}"
763765
);
764766
}
765767

@@ -825,8 +827,8 @@ mod tests {
825827
.expect("should compute name with custom timeout");
826828

827829
assert!(
828-
name.ends_with("_fb2000_bb2000"),
829-
"should encode 2000ms first-byte and between-bytes timeouts in name"
830+
name.contains("_fb2000_bb2000_"),
831+
"should encode 2000ms first-byte and between-bytes timeouts in name, got {name}"
830832
);
831833
}
832834

0 commit comments

Comments
 (0)