bd sync: 2025-12-23 22:33:32
This commit is contained in:
@@ -335,7 +335,11 @@ func TestExportUpdatesMetadata(t *testing.T) {
|
||||
|
||||
// Update metadata using the actual daemon helper function (bd-ar2.3 fix)
|
||||
// This verifies that updateExportMetadata (used by createExportFunc and createSyncFunc) works correctly
|
||||
mockLogger := newTestLogger()
|
||||
mockLogger := daemonLogger{
|
||||
logFunc: func(format string, args ...interface{}) {
|
||||
t.Logf(format, args...)
|
||||
},
|
||||
}
|
||||
updateExportMetadata(ctx, store, jsonlPath, mockLogger, "")
|
||||
|
||||
// Verify metadata was set (renamed from last_import_hash to jsonl_content_hash - bd-39o)
|
||||
@@ -434,7 +438,11 @@ func TestUpdateExportMetadataMultiRepo(t *testing.T) {
|
||||
}
|
||||
|
||||
// Create mock logger
|
||||
mockLogger := newTestLogger()
|
||||
mockLogger := daemonLogger{
|
||||
logFunc: func(format string, args ...interface{}) {
|
||||
t.Logf(format, args...)
|
||||
},
|
||||
}
|
||||
|
||||
// Update metadata for each repo with different keys (bd-ar2.2 multi-repo support)
|
||||
updateExportMetadata(ctx, store, jsonlPath1, mockLogger, jsonlPath1)
|
||||
@@ -546,7 +554,11 @@ func TestExportWithMultiRepoConfigUpdatesAllMetadata(t *testing.T) {
|
||||
|
||||
// Simulate multi-repo export flow (as in createExportFunc)
|
||||
// This tests the full integration: getMultiRepoJSONLPaths -> getRepoKeyForPath -> updateExportMetadata
|
||||
mockLogger := newTestLogger()
|
||||
mockLogger := daemonLogger{
|
||||
logFunc: func(format string, args ...interface{}) {
|
||||
t.Logf(format, args...)
|
||||
},
|
||||
}
|
||||
|
||||
// Simulate multi-repo mode with stable keys
|
||||
multiRepoPaths := []string{primaryJSONL, additionalJSONL}
|
||||
@@ -664,7 +676,11 @@ func TestUpdateExportMetadataInvalidKeySuffix(t *testing.T) {
|
||||
}
|
||||
|
||||
// Create mock logger
|
||||
mockLogger := newTestLogger()
|
||||
mockLogger := daemonLogger{
|
||||
logFunc: func(format string, args ...interface{}) {
|
||||
t.Logf(format, args...)
|
||||
},
|
||||
}
|
||||
|
||||
// Update metadata with keySuffix containing ':' (bd-web8: should be auto-sanitized)
|
||||
// This simulates Windows absolute paths like "C:\Users\..."
|
||||
|
||||
Reference in New Issue
Block a user