feat(orchestrator): worker pool run + account testing gate

This commit is contained in:
2026-07-01 18:04:44 +07:00
parent ec8835538b
commit 8c871d9d26
2 changed files with 243 additions and 0 deletions
@@ -0,0 +1,24 @@
package orchestrator
import (
"testing"
"github.com/vasyansk/imap-copier/internal/store"
)
func TestGateOK(t *testing.T) {
ok := []store.Account{
{TestSrcStatus: "ok", TestDstStatus: "ok"},
{TestSrcStatus: "ok", TestDstStatus: "ok"},
}
if !gateOK(ok) {
t.Fatal("all ok must pass gate")
}
bad := []store.Account{{TestSrcStatus: "ok", TestDstStatus: "fail"}}
if gateOK(bad) {
t.Fatal("any non-ok must fail gate")
}
if gateOK(nil) {
t.Fatal("empty accounts must fail gate")
}
}