registry: type metadata and yaml import timestamps

This commit is contained in:
a.tolmachev
2026-04-19 07:36:35 +00:00
parent 179165838a
commit 153f9cb108
7 changed files with 43 additions and 34 deletions
+6 -6
View File
@@ -920,7 +920,7 @@ fn build_sample_metadata(
storage_ref: String,
content_type: String,
file_name: Option<String>,
created_at: String,
created_at: OffsetDateTime,
) -> Result<OperationSampleMetadata, RegistryError> {
Ok(OperationSampleMetadata {
id: crank_core::SampleId::new(id),
@@ -943,7 +943,7 @@ fn build_descriptor_metadata(
storage_ref: String,
source_name: Option<String>,
package_index: Option<Value>,
created_at: String,
created_at: OffsetDateTime,
) -> Result<DescriptorMetadata, RegistryError> {
Ok(DescriptorMetadata {
id: crank_core::DescriptorId::new(id),
@@ -1335,7 +1335,7 @@ mod tests {
storage_ref: "file:///tmp/input.json".to_owned(),
content_type: "application/json".to_owned(),
file_name: Some("input.json".to_owned()),
created_at: "2026-03-25T12:01:00Z".to_owned(),
created_at: timestamp("2026-03-25T12:01:00Z"),
};
let descriptor = DescriptorMetadata {
id: "descriptor_01".into(),
@@ -1345,7 +1345,7 @@ mod tests {
storage_ref: "file:///tmp/schema.desc".to_owned(),
source_name: Some("schema.desc".to_owned()),
package_index: Some(json!({ "crm.v1": ["LeadService"] })),
created_at: "2026-03-25T12:02:00Z".to_owned(),
created_at: timestamp("2026-03-25T12:02:00Z"),
};
registry
@@ -1436,7 +1436,7 @@ mod tests {
source_sample_id: None,
format_version: "v1",
mode: ExportMode::Portable,
created_at: "2026-03-25T12:00:00Z",
created_at: &timestamp("2026-03-25T12:00:00Z"),
})
.await
.unwrap();
@@ -1449,7 +1449,7 @@ mod tests {
result_operation_id: Some(operation.id.clone()),
result_version: Some(2),
error_text: None,
finished_at: "2026-03-25T12:05:00Z".to_owned(),
finished_at: timestamp("2026-03-25T12:05:00Z"),
},
)
.await