feat(doubao): implement challenge handling and monitoring improvements
Desktop Client Build / Resolve Build Metadata (push) Successful in 26s
Frontend CI / Frontend (push) Successful in 3m12s
Backend CI / Backend (push) Failing after 10m8s
Desktop Client Build / Build Desktop Client (push) Successful in 23m53s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 26s
Desktop Client Build / Resolve Build Metadata (push) Successful in 26s
Frontend CI / Frontend (push) Successful in 3m12s
Backend CI / Backend (push) Failing after 10m8s
Desktop Client Build / Build Desktop Client (push) Successful in 23m53s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 26s
- Added classification for `doubao_challenge_required` as a challenge in platform-auth-adapters. - Enhanced account action summaries to include specific messages for Doubao human verification. - Introduced monitoring functions to filter out blocked platforms based on account health. - Updated task leasing to support platform-specific filtering for monitor tasks. - Refined issue aggregation in HomeView to consolidate Doubao challenge failures into a single actionable item. - Improved backend logic to handle platform IDs in task leasing requests and responses. - Added tests for new functionality, ensuring proper handling of Doubao challenges and task leasing logic.
This commit is contained in:
@@ -384,6 +384,68 @@ func TestMonitoringTaskReadyForQueuedResultAcceptsDesktopReceivedStatus(t *testi
|
||||
}
|
||||
}
|
||||
|
||||
func TestIdempotentDesktopMonitoringResultResponseAcceptsReceivedTerminalStates(t *testing.T) {
|
||||
for _, status := range []string{"received", "failed", "skipped"} {
|
||||
t.Run(status, func(t *testing.T) {
|
||||
got := idempotentDesktopMonitoringResultResponse(&monitoringCollectTask{
|
||||
ID: 123,
|
||||
ExecutionOwner: "desktop_tasks",
|
||||
Status: status,
|
||||
CallbackReceivedAt: sqlNullTimeForTest(),
|
||||
})
|
||||
|
||||
if got == nil {
|
||||
t.Fatal("idempotentDesktopMonitoringResultResponse() = nil, want response")
|
||||
}
|
||||
if got.TaskID != 123 {
|
||||
t.Fatalf("TaskID = %d, want 123", got.TaskID)
|
||||
}
|
||||
if got.TaskStatus != status {
|
||||
t.Fatalf("TaskStatus = %q, want %q", got.TaskStatus, status)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestIdempotentDesktopMonitoringResultResponseRequiresDesktopCallback(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
task monitoringCollectTask
|
||||
}{
|
||||
{
|
||||
name: "legacy received",
|
||||
task: monitoringCollectTask{
|
||||
ExecutionOwner: "legacy",
|
||||
Status: "received",
|
||||
CallbackReceivedAt: sqlNullTimeForTest(),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "desktop callback missing",
|
||||
task: monitoringCollectTask{
|
||||
ExecutionOwner: "desktop_tasks",
|
||||
Status: "received",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "desktop pending",
|
||||
task: monitoringCollectTask{
|
||||
ExecutionOwner: "desktop_tasks",
|
||||
Status: "pending",
|
||||
CallbackReceivedAt: sqlNullTimeForTest(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := idempotentDesktopMonitoringResultResponse(&tt.task); got != nil {
|
||||
t.Fatalf("idempotentDesktopMonitoringResultResponse() = %#v, want nil", got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func sqlNullTimeForTest() sql.NullTime {
|
||||
return sql.NullTime{Time: time.Now(), Valid: true}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user