Fix failing tests

- Replace --db flag tests with BEADS_DB env var tests in TestInitWithCustomDBPath
- Fix database closure issue in TestGitPullSyncIntegration by using local stores in subtests
- Remove backup files

Amp-Thread-ID: https://ampcode.com/threads/T-81a1f961-23c1-440b-b36f-d0ce823a5b16
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-27 20:08:50 -07:00
parent 1e2e066dc4
commit 6821b8ad4c
14 changed files with 2328 additions and 2235 deletions

View File

@@ -32,6 +32,12 @@ func createTestDBWithIssues(t *testing.T, issues []*types.Issue) (string, *sqlit
t.Cleanup(func() { testStore.Close() })
ctx := context.Background()
// Set issue_prefix to prevent "database not initialized" errors
if err := testStore.SetConfig(ctx, "issue_prefix", "test"); err != nil {
t.Fatalf("Failed to set issue_prefix: %v", err)
}
for _, issue := range issues {
if err := testStore.CreateIssue(ctx, issue, "test"); err != nil {
t.Fatalf("Failed to create issue %s: %v", issue.ID, err)