Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ci): fix non-deterministic test failure in import crate (#5233)

Eric Hayesa8d976e4af12
diff --git a/crates/import/src/domain/service.rs b/crates/import/src/domain/service.rs
index 9aaa382907..594ed1ae37 100644
--- a/crates/import/src/domain/service.rs
+++ b/crates/import/src/domain/service.rs
@@ -1978,6 +1978,11 @@ fn imported_notion_properties(
}
dedupe_strings(&mut imported.tags);
+ // `raw` iterates in whatever order `serde_json::Map` happens to use, which
+ // depends on the ambient `preserve_order` Cargo feature and can differ
+ // between build invocations. Sort explicitly so property order is
+ // deterministic regardless of that feature.
+ imported.values.sort_by(|a, b| a.name.cmp(&b.name));
imported
}
diff --git a/crates/import/src/domain/service/test.rs b/crates/import/src/domain/service/test.rs
index 0f8da61cdf..3d8a9934eb 100644
--- a/crates/import/src/domain/service/test.rs
+++ b/crates/import/src/domain/service/test.rs
@@ -309,16 +309,16 @@ fn notion_fetch_text_parses_the_fetch_document_shape() {
name: "Done".into(),
value: ImportedDocumentPropertyValue::Boolean { value: true },
},
- ImportedDocumentProperty {
- name: "Score".into(),
- value: ImportedDocumentPropertyValue::Number { value: 4.5 },
- },
ImportedDocumentProperty {
name: "Due".into(),
value: ImportedDocumentPropertyValue::Date {
value: "2026-08-01".into(),
},
},
+ ImportedDocumentProperty {
+ name: "Score".into(),
+ value: ImportedDocumentPropertyValue::Number { value: 4.5 },
+ },
]
);