bd sync: 2025-12-27 15:56:42

This commit is contained in:
Steve Yegge
2025-12-27 15:56:42 -08:00
parent 87f535a65e
commit c8b912cbe6
179 changed files with 3051 additions and 10283 deletions

View File

@@ -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