Skip to content

Commit 58631df

Browse files
test: fix vacuous assertion and incomplete serialization test in upload safeoutputs (#857)
test_default_container_folder_has_hash_suffix. The assertion compared a pure local function to itself (same arguments, same deterministic body) so it could never fail regardless of what the function returned. Determinism - upload_workitem_attachment: add missing comment-field assertion in test_result_serializes_correctly. The test constructed params with comment: Some("Test attachment") but never asserted the field appeared in the serialized JSON, meaning a regression that dropped comment from the serialized output would silently pass. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 72cbc2d commit 58631df

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

src/safeoutputs/upload_pipeline_artifact.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,12 +1065,6 @@ name-prefix: "ci-"
10651065
assert_ne!(a, b, "different content must produce different folders");
10661066
// Determinism: same inputs yield same folder.
10671067
assert_eq!(a, folder_for("TriageSummary", b"content-alpha"));
1068-
// Identical content → same folder regardless of call order (idempotent).
1069-
assert_eq!(
1070-
folder_for("TriageSummary", b"same-content"),
1071-
folder_for("TriageSummary", b"same-content"),
1072-
"same content must always map to the same folder"
1073-
);
10741068
}
10751069

10761070
/// When `require-unique-names` is set, the executor uses the clean folder

src/safeoutputs/upload_workitem_attachment.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ mod tests {
556556
assert!(json.contains(r#""name":"upload-workitem-attachment""#));
557557
assert!(json.contains(r#""work_item_id":42"#));
558558
assert!(json.contains(r#""file_path":"output/report.pdf""#));
559+
assert!(json.contains(r#""comment":"Test attachment""#));
559560
}
560561

561562
#[test]

0 commit comments

Comments
 (0)