worker を追加(yt-dlp によるダウンロード、段階別進捗、ffprobe 検査、実行中の取り消し)
This commit is contained in:
@@ -155,7 +155,7 @@ func TestQueueGroupsProgressAndPolling(t *testing.T) {
|
||||
t.Errorf("待ち行列に %q がない", want)
|
||||
}
|
||||
}
|
||||
if strings.Contains(body, errorMessage) || strings.Contains(body, `action="/jobs/1/cancel"`) || strings.Contains(body, "全体") {
|
||||
if strings.Contains(body, errorMessage) || !strings.Contains(body, `action="/jobs/1/cancel"`) || strings.Contains(body, "全体") {
|
||||
t.Errorf("不正な詳細・操作・全体進捗: %s", body)
|
||||
}
|
||||
fragment := getPage(handler, "/queue/list")
|
||||
@@ -195,7 +195,7 @@ func TestQueueJobsAppearInCorrectSectionsWithLimit(t *testing.T) {
|
||||
cancelAction := `action="/jobs/` + string(rune('1'+i)) + `/cancel"`
|
||||
retryAction := `action="/jobs/` + string(rune('1'+i)) + `/retry"`
|
||||
switch statuses[i] {
|
||||
case "queued":
|
||||
case "running", "queued":
|
||||
if !strings.Contains(section[1], cancelAction) || strings.Contains(section[1], retryAction) {
|
||||
t.Errorf("%s の操作が不正: %s", statuses[i], section[1])
|
||||
}
|
||||
@@ -246,9 +246,13 @@ func TestQueueCancelRetryAndStopPolling(t *testing.T) {
|
||||
if got := postForm(handler, "/jobs/bad/cancel", nil).Code; got != http.StatusBadRequest {
|
||||
t.Fatalf("不正な ID: %d", got)
|
||||
}
|
||||
if got := postForm(handler, "/jobs/99/cancel", nil).Code; got != http.StatusNotFound {
|
||||
t.Fatalf("存在しないジョブ: %d", got)
|
||||
}
|
||||
jobs.jobs["ep"] = store.Job{ID: 1, Status: "running"}
|
||||
if got := postForm(handler, "/jobs/1/cancel", nil).Code; got != http.StatusConflict {
|
||||
t.Fatalf("実行中の取り消し: %d", got)
|
||||
runningCanceled := postForm(handler, "/jobs/1/cancel", nil)
|
||||
if runningCanceled.Code != http.StatusOK || jobs.jobs["ep"].Status != "canceled" || !strings.Contains(runningCanceled.Body.String(), `action="/jobs/1/retry"`) {
|
||||
t.Fatalf("実行中の取り消し: %d %+v", runningCanceled.Code, jobs.jobs["ep"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user