Fix test failures: add missing issue_prefix config and use valid bd- prefixes
- Add SetConfig('issue_prefix', 'bd') to collision tests (bd-166)
- Update test cases to use 'bd-' prefix instead of invalid custom IDs (bd-177)
- Fixes 5 test failures in TestDetectCollisions, TestScoreCollisions, TestRemapCollisions, TestCreateIssues
All tests now pass.
Amp-Thread-ID: https://ampcode.com/threads/T-b2413b0e-2720-45b1-9b3d-acaa7d4cf9b4
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -29,6 +29,11 @@ func TestDetectCollisions(t *testing.T) {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
// Set issue prefix to prevent "database not initialized" errors
|
||||
if err := store.SetConfig(ctx, "issue_prefix", "bd"); err != nil {
|
||||
t.Fatalf("failed to set issue_prefix: %v", err)
|
||||
}
|
||||
|
||||
// Setup: Create some existing issues in the database
|
||||
existingIssue1 := &types.Issue{
|
||||
ID: testIssueBD1,
|
||||
@@ -531,6 +536,11 @@ func TestScoreCollisions(t *testing.T) {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
// Set issue prefix to prevent "database not initialized" errors
|
||||
if err := store.SetConfig(ctx, "issue_prefix", "bd"); err != nil {
|
||||
t.Fatalf("failed to set issue_prefix: %v", err)
|
||||
}
|
||||
|
||||
// Setup: Create issues with various reference patterns
|
||||
issue1 := &types.Issue{
|
||||
ID: "bd-1",
|
||||
@@ -801,6 +811,11 @@ func TestRemapCollisions(t *testing.T) {
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
// Set issue prefix to prevent "database not initialized" errors
|
||||
if err := store.SetConfig(ctx, "issue_prefix", "bd"); err != nil {
|
||||
t.Fatalf("failed to set issue_prefix: %v", err)
|
||||
}
|
||||
|
||||
// Setup: Create an existing issue in the database with a high ID number
|
||||
// This ensures that when we remap bd-2 and bd-3, they get new IDs that don't conflict
|
||||
existingIssue := &types.Issue{
|
||||
|
||||
Reference in New Issue
Block a user