(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func TestOrgRouterMigrationLock(t *testing.T) { |
| 17 | router := &OrgRouter{} |
| 18 | |
| 19 | if router.IsMigrating("org-1") { |
| 20 | t.Fatal("expected org-1 to not be migrating initially") |
| 21 | } |
| 22 | |
| 23 | router.SetMigrating("org-1") |
| 24 | if !router.IsMigrating("org-1") { |
| 25 | t.Fatal("expected org-1 to be migrating after SetMigrating") |
| 26 | } |
| 27 | |
| 28 | if router.IsMigrating("org-2") { |
| 29 | t.Fatal("expected org-2 to not be migrating") |
| 30 | } |
| 31 | |
| 32 | router.ClearMigrating("org-1") |
| 33 | if router.IsMigrating("org-1") { |
| 34 | t.Fatal("expected org-1 to not be migrating after ClearMigrating") |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | // newTestActivator creates a SharedWorkerActivator with fake k8s secrets |
| 39 | // and configurable activation behavior for migration lock testing. |
nothing calls this directly
no test coverage detected