bd sync: 2025-12-27 15:56:42
This commit is contained in:
@@ -410,49 +410,6 @@ func TestCheckLegacyJSONLConfig(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckDatabaseConfig_IgnoresSystemJSONLs(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
beadsDir := filepath.Join(tmpDir, ".beads")
|
||||
if err := os.Mkdir(beadsDir, 0750); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Configure issues.jsonl, but only create interactions.jsonl.
|
||||
metadataPath := filepath.Join(beadsDir, "metadata.json")
|
||||
if err := os.WriteFile(metadataPath, []byte(`{"database":"beads.db","jsonl_export":"issues.jsonl"}`), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(beadsDir, "interactions.jsonl"), []byte(`{"id":"x"}`), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
check := CheckDatabaseConfig(tmpDir)
|
||||
if check.Status != "ok" {
|
||||
t.Fatalf("expected ok, got %s: %s\n%s", check.Status, check.Message, check.Detail)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckDatabaseConfig_SystemJSONLExportIsError(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
beadsDir := filepath.Join(tmpDir, ".beads")
|
||||
if err := os.Mkdir(beadsDir, 0750); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
metadataPath := filepath.Join(beadsDir, "metadata.json")
|
||||
if err := os.WriteFile(metadataPath, []byte(`{"database":"beads.db","jsonl_export":"interactions.jsonl"}`), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(beadsDir, "interactions.jsonl"), []byte(`{"id":"x"}`), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
check := CheckDatabaseConfig(tmpDir)
|
||||
if check.Status != "error" {
|
||||
t.Fatalf("expected error, got %s: %s", check.Status, check.Message)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckFreshClone(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user