fix(ci): resolve lint errors and test failures
- Fix errcheck: handle watcher.Close() and Set() return values - Fix unparam: remove always-nil error from NewActivityWatcher - Fix unparam: remove unused sinceTime param, delete dead code - Fix version mismatch: update MCP __init__.py to 0.48.0 - Fix routing tests: change CWD so routing can find town root Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
8807a171d3
commit
83e3c75635
@@ -12,6 +12,8 @@ import (
|
||||
// TestAgentStateWithRouting tests that bd agent state respects routes.jsonl
|
||||
// for cross-repo agent resolution. This is a regression test for the bug where
|
||||
// bd agent state failed to find agents in routed databases while bd show worked.
|
||||
//
|
||||
// NOTE: This test uses os.Chdir and cannot run in parallel with other tests.
|
||||
func TestAgentStateWithRouting(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -73,6 +75,16 @@ func TestAgentStateWithRouting(t *testing.T) {
|
||||
dbPath = townDBPath
|
||||
t.Cleanup(func() { dbPath = oldDbPath })
|
||||
|
||||
// Change to tmpDir so routing can find town root via CWD
|
||||
oldWd, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to get working directory: %v", err)
|
||||
}
|
||||
if err := os.Chdir(tmpDir); err != nil {
|
||||
t.Fatalf("Failed to change to temp directory: %v", err)
|
||||
}
|
||||
t.Cleanup(func() { _ = os.Chdir(oldWd) })
|
||||
|
||||
// Test the routed resolution
|
||||
result, err := resolveAndGetIssueWithRouting(ctx, townStore, "gt-testrig-polecat-test")
|
||||
if err != nil {
|
||||
@@ -115,6 +127,8 @@ func TestNeedsRoutingFunction(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestAgentHeartbeatWithRouting tests that bd agent heartbeat respects routes.jsonl
|
||||
//
|
||||
// NOTE: This test uses os.Chdir and cannot run in parallel with other tests.
|
||||
func TestAgentHeartbeatWithRouting(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -167,6 +181,16 @@ func TestAgentHeartbeatWithRouting(t *testing.T) {
|
||||
dbPath = townDBPath
|
||||
t.Cleanup(func() { dbPath = oldDbPath })
|
||||
|
||||
// Change to tmpDir so routing can find town root via CWD
|
||||
oldWd, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to get working directory: %v", err)
|
||||
}
|
||||
if err := os.Chdir(tmpDir); err != nil {
|
||||
t.Fatalf("Failed to change to temp directory: %v", err)
|
||||
}
|
||||
t.Cleanup(func() { _ = os.Chdir(oldWd) })
|
||||
|
||||
// Test that we can resolve the agent from the town directory
|
||||
result, err := resolveAndGetIssueWithRouting(ctx, townStore, "gt-test-witness")
|
||||
if err != nil {
|
||||
@@ -189,6 +213,8 @@ func TestAgentHeartbeatWithRouting(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestAgentShowWithRouting tests that bd agent show respects routes.jsonl
|
||||
//
|
||||
// NOTE: This test uses os.Chdir and cannot run in parallel with other tests.
|
||||
func TestAgentShowWithRouting(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -241,6 +267,16 @@ func TestAgentShowWithRouting(t *testing.T) {
|
||||
dbPath = townDBPath
|
||||
t.Cleanup(func() { dbPath = oldDbPath })
|
||||
|
||||
// Change to tmpDir so routing can find town root via CWD
|
||||
oldWd, err := os.Getwd()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to get working directory: %v", err)
|
||||
}
|
||||
if err := os.Chdir(tmpDir); err != nil {
|
||||
t.Fatalf("Failed to change to temp directory: %v", err)
|
||||
}
|
||||
t.Cleanup(func() { _ = os.Chdir(oldWd) })
|
||||
|
||||
// Test that we can resolve the agent from the town directory
|
||||
result, err := resolveAndGetIssueWithRouting(ctx, townStore, "gt-myrig-crew-alice")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user